NaN handling

Dan Bishop danb_83 at yahoo.com
Sat May 6 04:30:24 EDT 2006


Ivan Vinogradov wrote:
> > <snip>
> > NaNs are handled.
>
> Throwing an exception would be nice in regular Python (non-scipy).
>
> This works to catch NaN on OSX and Linux:
>
> # assuming x is a number
> if x+1==x or x!=x:
> 	#x is NaN

x != x works, but:

>>> x = 1e100
>>> x + 1 == x
True




More information about the Python-list mailing list