Commit d412ab52 authored by Mark Dickinson's avatar Mark Dickinson

Merged revisions 75454 via svnmerge from

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
........
parent 2b6eb183
No related merge requests found
...@@ -43,7 +43,7 @@ def to_ulps(x): ...@@ -43,7 +43,7 @@ def to_ulps(x):
where C doubles are represented in IEEE 754 binary64 format. 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: if n < 0:
n = ~(n+2**63) n = ~(n+2**63)
return n return n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment