Boost C++ Libraries: Ticket #12083: Rounding mode not restored when using save_state rounding struct on x64 https://svn.boost.org/trac10/ticket/12083 <p> The rounding mode is not restored when using interval_lib's save_state rounding struct on x64 when an exception is thrown (Visual Studio 2013/2015). This can have critical impact on applications. All rounding will remain downward after catching the exception. This bug does not occur in Win32. </p> <p> We've also reported this issue to Microsoft: <a class="ext-link" href="https://connect.microsoft.com/VisualStudio/Feedback/Details/2487437"><span class="icon">​</span>https://connect.microsoft.com/VisualStudio/Feedback/Details/2487437</a> </p> <p> Boost Repro: </p> <p> #include &lt;boost/numeric/interval.hpp&gt; </p> <p> void test_interval_number::test_boost_rounding() { </p> <blockquote> <p> try { </p> <blockquote> <p> boost::numeric::interval&lt;double&gt;::traits_type::rounding rnd; rnd.downward(); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> throw 1; </p> </blockquote> <p> } catch (...) { </p> </blockquote> <blockquote> <p> } </p> </blockquote> <blockquote> <p> unsigned int fpu_flags = 0; errno_t err; </p> </blockquote> <blockquote> <p> err = _controlfp_s(&amp;fpu_flags, 0, 0); assert(err == 0); </p> </blockquote> <blockquote> <p> assert((fpu_flags &amp; _MCW_RC) != _RC_DOWN); </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12083 Trac 1.4.3