]> granicus.if.org Git - python/commitdiff
Merged revisions 75454 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Sat, 17 Oct 2009 07:10:00 +0000 (07:10 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 17 Oct 2009 07:10:00 +0000 (07:10 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75454 | mark.dickinson | 2009-10-17 08:06:37 +0100 (Sat, 17 Oct 2009) | 1 line

  test_math ulp computation was wrong on big-endian systems
........

Lib/test/test_math.py

index 6d06fef4cdf99a5c697408a8cd5e3449ee5dbd34..2226023155199f961896013810edd4eb9f68dc15 100644 (file)
@@ -43,7 +43,7 @@ def to_ulps(x):
     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