Subject: [Boost-bugs] [Boost C++ Libraries] #10188: Loses floating point precision on round trip
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-10 13:54:12
#10188: Loses floating point precision on round trip
----------------------------------------------+---------------------------
Reporter: Magne OEstlyngen <magne+boost@â¦> | Owner: cornedbee
Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
Version: Boost Development Trunk | Severity: Problem
Keywords: |
----------------------------------------------+---------------------------
ptrees stream_translator uses a precision of
std::numeric_limits<F>::digits10 + 1 when converting floating point
values. This is not always enough, and a more correct value would be
digits10+2 or max_digits10 (c++11 only). See ticket:9177 for a similar
issue.
The attached test produces the following output pre-patch:
{{{
in : -1.8312345000098765e-08
out: -1.8312345000098762e-08
Wrong
}}}
and after patch:
{{{
in : -1.8312345000098765e-08
out: -1.8312345000098765e-08
Right
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10188> 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