Subject: [Boost-bugs] [Boost C++ Libraries] #10103: setprecision(0) does displays too many digits of a float128
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-06-07 12:38:29
#10103: setprecision(0) does displays too many digits of a float128
----------------------------------------+----------------------------
Reporter: Charles Karney <charles@â¦> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.54.0 | Severity: Problem
Keywords: printing |
----------------------------------------+----------------------------
setprecision(0) is not honored for float128. Compare
the display of a double and a float128 (default and fixed):
{{{
0.1 0.123400000000000000000000000000000006
0 0.123400000000000000000000000000000006
}}}
This is produced with
{{{
#include <iostream>
#include <boost/multiprecision/float128.hpp>
int main() {
double x = 0.1234;
boost::multiprecision::float128 y = 0.1234Q;
std::cout << std::setprecision(0) << x << " " << y << "\n";
std::cout << std::fixed << x << " " << y << "\n";
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10103> 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:16 UTC