Boost C++ Libraries: Ticket #12881: Reducing the precision integer division in VS 2015 and above https://svn.boost.org/trac10/ticket/12881 <p> The result of the following code is different in VS 2013 and VS 2015:<br />VS 2013 output "6"<br />VS 2015 output "5.9999999..9977"<br /> </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/multiprecision/cpp_dec_float.hpp&gt; int main() { boost::multiprecision::cpp_dec_float_50 num = 180; boost::multiprecision::cpp_dec_float_50 res = num / 30; std::cout.precision(100); std::cout &lt;&lt; res; std::getchar(); return 0; } </pre><p> The difference is explained by the presence in the file "boost\multiprecision\detail\default_ops.hpp" 2 block of code with check </p> <pre class="wiki">#if !BOOST_WORKAROUND(BOOST_MSVC, &lt; 1900) ... #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12881 Trac 1.4.3 John Maddock Sat, 30 Dec 2017 18:50:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12881#comment:1 https://svn.boost.org/trac10/ticket/12881#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Duplicates <a class="ext-link" href="https://svn.boost.org/trac10/ticket/11178"><span class="icon">​</span>https://svn.boost.org/trac10/ticket/11178</a> </p> <p> Notwithstanding that this is annoying, it is also expected behaviour for division with cpp_dec_float. MSVC post 2015 actually goes via a more efficient code path that preserves the internal result of the division. </p> Ticket