mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-130317: Fix SNaN broken tests on HP PA RISC (#140452)
While looking at #140028, I found some unrelated test regressions in the 3.14 cycle. These seem to all come from #130317. From what I can tell, that made Python more correct than it was before. According to [0], HP PA RISC uses 1 for SNaN and thus a 0 for QNaN. [0]: https://grouper.ieee.org/groups/1788/email/msg03272.html
This commit is contained in:
parent
d2f3cfd384
commit
76fea5596c
2 changed files with 15 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import math
|
||||
import random
|
||||
import platform
|
||||
import sys
|
||||
import unittest
|
||||
import warnings
|
||||
|
|
@ -197,6 +198,10 @@ def test_pack_unpack_roundtrip_for_nans(self):
|
|||
# PyFloat_Pack/Unpack*() API. See also gh-130317 and
|
||||
# e.g. https://developercommunity.visualstudio.com/t/155064
|
||||
signaling = 0
|
||||
if platform.machine().startswith('parisc'):
|
||||
# HP PA RISC uses 0 for quiet, see:
|
||||
# https://en.wikipedia.org/wiki/NaN#Encoding
|
||||
signaling = 1
|
||||
quiet = int(not signaling)
|
||||
if size == 8:
|
||||
payload = random.randint(signaling, 0x7ffffffffffff)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue