[Boost-bugs] [Boost C++ Libraries] #11159: With float128 x = nan, the test x > 0 evaluates to true

Subject: [Boost-bugs] [Boost C++ Libraries] #11159: With float128 x = nan, the test x > 0 evaluates to true
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-31 14:50:40


#11159: With float128 x = nan, the test x > 0 evaluates to true
--------------------------------+----------------------------
 Reporter: charles@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: float128 nan tests |
--------------------------------+----------------------------
 On Linux with boost 1.57, executing the following code

 {{{
 #include <iostream>
 #include <limits>
 #include <boost/multiprecision/float128.hpp>

 int main() {
   typedef boost::multiprecision::float128 real;
   real x = std::numeric_limits<real>::quiet_NaN();
   std::cout << "x: " << x << "\n"
             << "x == 0: " << (x == 0) << "\n"
             << "x > 0: " << (x > 0) << "\n"
             << "x < 0: " << (x < 0) << "\n"
             << "x >= 0: " << (x >= 0) << "\n"
             << "x <= 0: " << (x <= 0) << "\n"
             << "x != 0: " << (x != 0) << "\n";
   return 0;
 }
 }}}
 gives
 {{{
 x: nan
 x == 0: 0
 x > 0: 1
 x < 0: 0
 x >= 0: 1
 x <= 0: 0
 x != 0: 1
 }}}

 I should get
 {{{
 x: nan
 x == 0: 0
 x > 0: 0
 x < 0: 0
 x >= 0: 0
 x <= 0: 0
 x != 0: 1
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11159>
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:18 UTC