Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of convert_to<double>() is a subnormal
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-08 21:47:03
#12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of
convert_to<double>() is a subnormal
-------------------------------+----------------------------
Reporter: Michael Shatz | Owner: johnmaddock
Type: Bugs | Status: reopened
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.62.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------------
Comment (by Michael Shatz):
Unfortunately, you are right.
Still, I can think about another workaround to keep my workaround alive:
1. Convert to cpp_bin_float<N+52>
2. add numeric_limits::min(). Now addition is exact!
3. convert to double
4. subtract numeric_limits::min().
Practically it's probably faster to convert to cpp_bin_float<N+64>
BTW, special-casing of (x.backend().exponent() < -1023 - 52) in my code is
a performance optimization. This step is not necessary for correction.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12527#comment:9> 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