Surprise with special floating point values
prouleau001 at gmail.com
prouleau001 at gmail.com
Wed Nov 29 13:02:09 EST 2006
On Nov 29, 12:53 pm, prouleau... at gmail.com wrote:
> Hi all,
>
> While trying to use simplejson under Python 2.4.3 I have been
> investigating the handling of special floating point values and found
> that both Python 2.4 and 2.5 return False when comparing a NaN with
> itself. Although surprising, I imagine it could also be correct since
> NaN is not a number. But is it correct?
And of course it is correct... As NaN does not compare with itself in
floating point: http://en.wikipedia.org/wiki/NaN
Should have read it earlier...
> --
> Pierre Rouleau
More information about the Python-list
mailing list