nails cxx error

Torbjorn Granlund tg at swox.com
Sun Nov 9 00:52:14 CET 2008


Torbjorn Granlund <tg at swox.com> writes:

  Torbjorn Granlund <tg at swox.com> writes:
  
    A patch is at <http://gmplib.org/#STATUS>.
    
  I now realize that my patch doesn't fully solve the problem.  mpf_eq
  might still involve too many bits in the comparison.
  
  To get things tight, one needs to locate the position of the most
  significant bit of the operands, and count bits downwards from there.
  
It turned out that mpf_eq was much worse than I first realized.  It
could not only (as documented) compare too many bits, but very often
also compared too few bits, which is quite bad.  It has been broken
like that since the first release of it.  Hopefully, most people use
the mathematically better defined mpf_reldiff.

I have replaced the patch at <http://gmplib.org/#STATUS>.  It now
patches both the test case (which took advantage of the too few bug!)
and the mpf_eq function.

-- 
Torbjörn


More information about the gmp-bugs mailing list