[Boost-bugs] [Boost C++ Libraries] #12112: cpp_dec_float: assigning double(-infinity) drops the negative

Subject: [Boost-bugs] [Boost C++ Libraries] #12112: cpp_dec_float: assigning double(-infinity) drops the negative
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-04-05 01:54:23


#12112: cpp_dec_float: assigning double(-infinity) drops the negative
-----------------------------------------+----------------------------
 Reporter: Jason Rhinelander <jason@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
  Version: Boost 1.60.0 | Severity: Problem
 Keywords: |
-----------------------------------------+----------------------------
 Initializing (or assigning) negative infinity to a cpp_dec_float assigns
 positive infinity instead of negative infinity.

 The problem seems to be that cpp_dec_float.hpp, in operator=(long double
 a), does:

 {{{
    if((boost::math::isinf)(a))
       return *this = inf();
 }}}

 but I think that should instead be (I have not tested this):

 {{{
     if((boost::math::isinf)(a)) {
        *this = inf();
        if (a < 0) negate();
        return *this;
     }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12112>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC