mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
test_math ulp computation was wrong on big-endian systems
This commit is contained in:
parent
0447cd6fdc
commit
59ca92093c
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue