Boost C++ Libraries: Ticket #12525: cpp_bin_float: Anal fixation. Part 2. Sign of trunc(x) for x in range (-1..0) https://svn.boost.org/trac10/ticket/12525 <p> trunc(x) for x in range (-1..0). </p> <p> I have no idea what IEEE-754 says about it, but I see that in practice all sane implementations return -0. </p> <p> Except for boost::cpp_bin_float. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12525 Trac 1.4.3 Michael Shatz Thu, 13 Oct 2016 20:20:56 GMT attachment set https://svn.boost.org/trac10/ticket/12525 https://svn.boost.org/trac10/ticket/12525 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">af_p2.cpp</span> </li> </ul> <p> demonstrates unexpected sign of zero as result of trunc() </p> Ticket John Maddock Wed, 26 Oct 2016 17:50:06 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/12525#comment:1 https://svn.boost.org/trac10/ticket/12525#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">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> <p> Thanks, this also effects round and ceil as well as trunc. Fixed in <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/ed43204e925aa604061b33315fa7db7002689fdc"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/ed43204e925aa604061b33315fa7db7002689fdc</a>. </p> Ticket