Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7785: karma real generator limits precision to digits10 no matter exponent
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-13 12:44:11
#7785: karma real generator limits precision to digits10 no matter exponent
-------------------------------+--------------------------------------------
Reporter: strk@⦠| Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by Sandro Santilli <strk@â¦>):
The problem is in call_n, where fractional part is normalized even if the
format flag is
requesting fixed precision, despite the comment above (saying
normalization is only needed for scientific notation).
This patch would fix my case:
{{{
--- real_utils.hpp.000 2012-12-13 13:42:01.000000000 +0100
+++ real_utils.hpp 2012-12-13 13:43:02.000000000 +0100
@@ -85,5 +85,5 @@
// get correct precision for generated number
unsigned precision = p.precision(n);
- if (std::numeric_limits<U>::digits10)
+ if (std::numeric_limits<U>::digits10 &&
!(Policies::fmtflags::fixed & flags))
{
// limit generated precision to digits10, if defined
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7785#comment:3> 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:11 UTC