Re: [Boost-bugs] [Boost C++ Libraries] #10103: setprecision(0) does displays too many digits of a float128

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10103: setprecision(0) does displays too many digits of a float128
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-14 14:40:49


#10103: setprecision(0) does displays too many digits of a float128
-----------------------------------------+----------------------------
  Reporter: Charles Karney <charles@…> | Owner: johnmaddock
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords: printing
-----------------------------------------+----------------------------

Comment (by Charles Karney <charles@…>):

 With C++11 manipulators, I recommend that

 {{{
 cout << scientific << setprecision(0) << x;
 cout << hexfloat << setprecision(0) << x;
 }}}

 should print lossless representations of x. While

 {{{
 cout << fixed << setprecision(0) << x;
 cout << defaultfloat << setprecision(0) << x;
 }}}

 should mimic whatever the standard library does with doubles.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10103#comment:4>
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:19 UTC