struct doesn't handle NaN values?

Grant Edwards grante at visi.com
Thu May 13 18:37:47 EDT 2004


On 2004-05-13, John Roth <newsgroups at jhrothjr.com> wrote:

>> > /* XXX This sadly ignores Inf/NaN issues */
>> >
>> > That is, the outcome of this is also an accident.
>>
>> Ah. That needs to be fixed.  It should either return a correct
>> value or raise an exception.  Silently returning wrong answers
>> is hardly the way of "least surprises".
>
> A lot of people would like the whole mess to be fixed.
> Unfortunately, nobody has stepped forward to do it,
> considering that it's quite a job to do right.

Fixing struct would be a start, but I'm a little confused by
the documentation.  

There's a table that clearly defines when it uses "native" vs.
"standard" byte-order and size-and-alignment.  

One assumes that the floating point _representation_ could
likewise be native or standard (IEEE), but it never specifies
which FP representation is used when.  Since "IEEE" is
mentioned in the discussion of "standard size and alignment", I
would guess that FP native vs. standard representation matches
the native vs. standard state of "size and alignment". 

Is that how others interpret the doc?

Is that the behavior others would want?

-- 
Grant Edwards                   grante             Yow!  They don't hire
                                  at               PERSONAL PINHEADS,
                               visi.com            Mr. Toad!



More information about the Python-list mailing list