Skip to content

Commit de7b6aa

Browse files
committed
+ enable test_pack_unpack_roundtrip_nans on win32 for qNaN's
1 parent c7c08ff commit de7b6aa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Lib/test/test_capi/test_float.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,18 @@ def test_pack_unpack_roundtrip(self):
179179
else:
180180
self.assertEqual(value2, value)
181181

182-
@unittest.skipUnless(HAVE_IEEE_754 and sys.platform != 'win32',
183-
"requires IEEE 754")
182+
@unittest.skipUnless(HAVE_IEEE_754, "requires IEEE 754")
184183
def test_pack_unpack_roundtrip_nans(self):
185184
pack = _testcapi.float_pack
186185
unpack = _testcapi.float_unpack
187186

188187
for _ in range(100):
189188
for size in (2, 4, 8):
190189
sign = random.randint(0, 1)
191-
quiet = random.randint(0, 1)
190+
if sys.platform != 'win32':
191+
quiet = random.randint(0, 1)
192+
else:
193+
quiet = 1 # doesn't work for sNaN's here
192194
if size == 8:
193195
payload = random.randint(0 if quiet else 1, 1<<50)
194196
i = (sign<<63) + (0x7ff<<52) + (quiet<<51) + payload

0 commit comments

Comments
 (0)