[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reldiff bug in GMP 4.1.2 unpatched (and also 4.1.3 unpatched)
From: |
Kevin Ryde |
Subject: |
Re: reldiff bug in GMP 4.1.2 unpatched (and also 4.1.3 unpatched) |
Date: |
Wed, 12 May 2004 08:38:43 +1000 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
address@hidden writes:
>
> mpf_set_ui(a, 1); // a = 1
> mpf_set_ui(b, 1);
> mpf_div_2exp(b, b, 65);
> mpf_add(b, b, a); // b = 1 + 2^(-65)
>
> mpf_reldiff(rd, a, b); // should be about 2^(-65), but gives zero
Thanks, that's a bug. mpf_reldiff keeps only one or two limbs of the
difference a-b, so doesn't satisfy the destination requested
precision.
I'd noticed this too not so long ago, and have prepared the new code
below for the next release. The precision for the subtract should now
be correct. (But to get the right answers in all cases it will need
new mpf_div and a not yet amended mpf_sub.)
--
All followups to address@hidden please.
reldiff.c
Description: Text Data