Bill Allombert on Mon, 4 Nov 2002 20:17:07 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: bug in pari-gp precision?


On Mon, Nov 04, 2002 at 12:31:13PM -0500, Walter Neumann wrote:
> 
> I just came across another (the same?) problem (current CVS):
> 
> ? 2.0^100 - 10^-29 - 2.0^100
> %1 = 32.0000000

Well I am not sure it is a bug but:

? 2.0^100
%4 = 1.267650600228229401496703205 E30
? \x
[&=080e21ec] REAL(lg=5,CLONE):05000005  (+,expo=100):40800064  80000000  00000000  00000000
? 2.0^100-10^-29
%3 = 1.267650600228229401496703205 E30
? \x
[&=080e213c] REAL(lg=5,CLONE):05000005  (+,expo=100):40800064  80000000  00000000  00000001

The last bit change seems suspicious to me.

> Admittedly, this is a big improvement over the 2.1.4 release:
> 
> (12:15) gp > 2.0^100-10^-29+2.0^100
> %1 = 2.535301200456458802993406410 E30

If you really enter +2.0^100 the result is correct...
With the same release
? 2.0^100-10^-29-2.0^100
%1 = 0.E2

> But in both cases 0. or less would be nicer!
So 2.1.4 is OK, but 2.2.5 is broken.

Cheers,
Bill.