Jeroen Demeyer on Tue, 23 Sep 2014 12:48:33 +0200


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

Non-zero number plus zero is zero?


Hello pari-dev,

The following is probably consistent with PARI's floating point model, but it was certainly surprising to me: a non-zero number plus 0 can be 0:

gp> 1 + 0e1
%1 = 0.E1

An easy proof of 1 == 0 in PARI/GP:

gp> 0e1 == 1
%5 = 1

which is also inconsistent with:

gp> 0e1 < 1
%13 = 1
gp> 0e1 >= 1
%17 = 0

Do you consider this a bug?

Cheers,
Jeroen.