struct doesn't handle NaN values?

Tim Peters tim.one at comcast.net
Thu May 13 22:51:09 EDT 2004


[Grant Edwards]
> My question was which "native" and "standard" mode?
> There appear to be two different "modes": "byte order" and "size and
> alignment".  Which of the two modes determines the floating
> point representation to be used?  My interpretation of the doc
> was the latter: use native FP representation when it says
> "native" in the "size and alignment" column and use IEEE when
> it says "standard" in the "size and alignment" column.

Yes, that's correct.

...

> In order to provide robust translation between native and IEEE
> floating point formats, Python is going to have to know what
> the native format is.

Of course. 
 
> Recognizing and generating IEEE NaNs, infinities, 0's and-
> denormals is easy enough.
[etc]

There's nothing new to be said about any of this, and I don't have time to
pursue it regardless.  If you want to commit to improving the story here,
please do.  Others have tried, over the course of a decade, but nothing has
come of it apart from the PEP 754 reference implementation (which doesn't
address struct or pickle issues).  It's a large task to give Python a *good*
x-platform 754 story, but it would indeed be easy to make large isolated
improvements in small areas on major platforms.






More information about the Python-list mailing list