Boost C++ Libraries: Ticket #12112: cpp_dec_float: assigning double(-infinity) drops the negative https://svn.boost.org/trac10/ticket/12112 <p> Initializing (or assigning) negative infinity to a cpp_dec_float assigns positive infinity instead of negative infinity. </p> <p> The problem seems to be that cpp_dec_float.hpp, in operator=(long double a), does: </p> <pre class="wiki"> if((boost::math::isinf)(a)) return *this = inf(); </pre><p> but I think that should instead be (I have not tested this): </p> <pre class="wiki"> if((boost::math::isinf)(a)) { *this = inf(); if (a &lt; 0) negate(); return *this; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12112 Trac 1.4.3 John Maddock Tue, 05 Apr 2016 18:33:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12112#comment:1 https://svn.boost.org/trac10/ticket/12112#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> </ul> <p> Thanks, that exposed a number of related issues, fixed in <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/aeab24b4fbb5738740d40beb1c55aad039ca1ac1"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/aeab24b4fbb5738740d40beb1c55aad039ca1ac1</a> </p> Ticket