Re: [Boost-bugs] [Boost C++ Libraries] #11102: gmp_float backend with variable precision does not have distributive property

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11102: gmp_float backend with variable precision does not have distributive property
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-11 19:16:23


#11102: gmp_float backend with variable precision does not have distributive
property
------------------------------------------+----------------------------
  Reporter: Tobias Beck <Tobias.Beck@…> | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.57.0 | Severity: Problem
Resolution: invalid | Keywords:
------------------------------------------+----------------------------
Changes (by johnmaddock):

 * status: new => closed
 * resolution: => invalid

Comment:

 Why would you expect this to work? Due to the way floating point values
 work there will always be roundoff error and I would not in general expect
 those two expressions to be exactly equal - even for type double. In
 point of fact, at least on my system they are equal when using the MPFR or
 cpp_bin_float backends (both of which are exactly rounded), but not for
 the GMP backend which does not round operations at all. Even so, I bet
 there are certain input values that will fail for MPFR and cpp_bin_float
 as well. The reason it works for you when initializing from a double is
 that you are only seeding a few of the bits in the mantissa with random
 values, and therefore there is never any rounding in any of thre
 operations. Seed of all of the bits in the mantissa with random values
 and any floating point type will fail this test.

 Please reopen if I've misunderstood your point.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11102#comment:2>
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:18 UTC