summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-03-20 18:32:13 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-03-20 18:32:13 (GMT)
commitd50ade68ec240ea8ea12604809d8c70985263dce (patch)
tree7dd938bc5a9dcf40707839e518420804bbb3cd94 /Misc
parent62364ffb80a7dab0477fe7dc7aec5478ab6afec2 (diff)
downloadcpython-d50ade68ec240ea8ea12604809d8c70985263dce.zip
cpython-d50ade68ec240ea8ea12604809d8c70985263dce.tar.gz
cpython-d50ade68ec240ea8ea12604809d8c70985263dce.tar.bz2
SF bug 705836: struct.pack of floats in non-native endian order
pack_float, pack_double, save_float: All the routines for creating IEEE-format packed representations of floats and doubles simply ignored that rounding can (in rare cases) propagate out of a long string of 1 bits. At worst, the end-off carry can (by mistake) interfere with the exponent value, and then unpacking yields a result wrong by a factor of 2. In less severe cases, it can end up losing more low-order bits than intended, or fail to catch overflow *caused* by rounding. Bugfix candidate, but I already backported this to 2.2. In 2.3, this code remains in severe need of refactoring.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS8
1 files changed, 8 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index baa3da3..3fb44c1 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,14 @@ Core and builtins
Extension modules
-----------------
+- The platform-independent routines for packing floats in IEEE formats
+ (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
+ pickling of floats) ignored that rounding can cause a carry to
+ propagate. The worst consequence was that, in rare cases, <f and >f
+ could produce strings that, when unpacked again, were a factor of 2
+ away from the original float. This has been fixed. See SF bug
+ #705836.
+
- New function time.tzset() provides access to the C library tzet()
function, if supported. (SF patch #675422.)