[Python-checkins] r75454 - python/trunk/Lib/test/test_math.py

mark.dickinson python-checkins at python.org
Sat Oct 17 09:06:38 CEST 2009


Author: mark.dickinson
Date: Sat Oct 17 09:06:37 2009
New Revision: 75454

Log:
test_math ulp computation was wrong on big-endian systems

Modified:
   python/trunk/Lib/test/test_math.py

Modified: python/trunk/Lib/test/test_math.py
==============================================================================
--- python/trunk/Lib/test/test_math.py	(original)
+++ python/trunk/Lib/test/test_math.py	Sat Oct 17 09:06:37 2009
@@ -43,7 +43,7 @@
     where C doubles are represented in IEEE 754 binary64 format.
 
     """
-    n = struct.unpack('q', struct.pack('<d', x))[0]
+    n = struct.unpack('<q', struct.pack('<d', x))[0]
     if n < 0:
         n = ~(n+2**63)
     return n


More information about the Python-checkins mailing list