[issue705836] struct.pack of floats in non-native endian order

Mark Dickinson report at bugs.python.org
Sun Jan 20 03:07:50 CET 2008


Mark Dickinson added the comment:

Aha:  the C99 standard, section 6.3.1.5, says:

When a double is demoted to float, a long double is demoted to double or
float, or a value being represented in greater precision and range than required by its
semantic type (see 6.3.1.8) is explicitly converted to its semantic type [...] if the value 
being converted is outside the range of values that can be represented, the behavior is 
undefined.

So the current code likely has different behaviours even on different IEEE-754 platforms.

____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue705836>
____________________________________


More information about the Python-bugs-list mailing list