[Boost-bugs] [Boost C++ Libraries] #12500: cpp_bin_float default value is NaN. But should be 0 according to the documentation.

Subject: [Boost-bugs] [Boost C++ Libraries] #12500: cpp_bin_float default value is NaN. But should be 0 according to the documentation.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-10-05 01:37:15


#12500: cpp_bin_float default value is NaN. But should be 0 according to the
documentation.
------------------------------+----------------------------
 Reporter: alex@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
  Version: Boost 1.62.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------------
 What should be:
 "Default constructed cpp_bin_floats have a value of zero."
 http://www.boost.org/doc/libs/1_61_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_bin_float.html

 This seems quite natural and convenient.

 But in reality the default constructor seems to make NaN. And its code
 seems to confirm that as far as I can see:

 cpp_bin_float() : m_data(), m_exponent(exponent_nan), m_sign(false) {}

 As a result cpp_bin_float can't be used with
 boost::numeric::ublas::symmetric_matrix.

 E.g. in boost\numeric\ublas\functional.hpp

 in struct matrix_norm_inf

 in real_type u = real_type ();

 it is expected that the default value is 0.

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