mpf_sub bug (essentially same as reldiff bug)

abbott at module.dima.unige.it abbott at module.dima.unige.it
Wed May 12 13:38:09 CEST 2004


On Wed, 12 May 2004, Kevin Ryde wrote:

> >   mpf_sub(rd, a, b);   // should be about 2^(-129), but gives zero
>
> Thanks, that's a bug.
>
> I think this case of nearly equal values is meant to work, you can see
> the loop in mpf/sub.c under ediff==0 which skips equal high limbs.
> Have to check what's not happening.

I wrongly get 0 if
   requested precision of a and b is 256
   a = 1   and b = 1+2^(-129)
   requested precision of rd is at most 64

I get the RIGHT answer if
   a and b as before BUT
   requested precision of rd is increased beyond 64
   [I tried several values beyond 64, but not all of them :-]


Hope this helps, and thanks for the speedy response.
John.



More information about the gmp-bugs mailing list