NaN handling

Grant Edwards grante at
Sat May 6 23:06:00 CEST 2006

On 2006-05-06, Terry Reedy <tjreedy at> wrote:

>> That's Python 2.4.1 on Mac OS X.
>>>> float("NaN")
> Traceback (most recent call last):
>   File "<pyshell#5>", line 1, in -toplevel-
>     float("NaN")
> ValueError: invalid literal for float(): NaN
> As Tim Peters has said often enough, this sort of thing is specific to the 
> underlying C library and will remain so until someone cares enough to write 
> or fund a cross-platform solution.

Yea, that's a royal PITA.  I had to add my own code into the
"pickle" classes to handle NaNs.  Having a pickler that only
works for a subset of the legal IEEE FP values proved to be
sort of useless.

Grant Edwards                   grante             Yow!  Were these parsnips
                                  at               CORRECTLY MARINATED in
                                 TACO SAUCE?

More information about the Python-list mailing list