Skip to content

Commit 7dba022

Browse files
committed
Add test_fma_zero_result2()
1 parent c95e6f9 commit 7dba022

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_math.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2806,6 +2806,13 @@ def test_fma_zero_result(self):
28062806
self.assertIsPositiveZero(math.fma(-tiny, -tiny, -0.0))
28072807
self.assertIsNegativeZero(math.fma(-tiny, tiny, -0.0))
28082808

2809+
# gh-73468: On some platforms, libc fma() doesn't implement IEE 754-2008
2810+
# properly: it doesn't use the right sign when the result is zero.
2811+
@unittest.skipIf(
2812+
sys.platform.startswith(("freebsd", "netbsd", "emscripten"))
2813+
or (sys.platform == "android" and platform.machine() == "x86_64"),
2814+
f"this platform doesn't implement IEE 754-2008 properly")
2815+
def test_fma_zero_result2(self):
28092816
# Corner case where rounding the multiplication would
28102817
# give the wrong result.
28112818
x = float.fromhex('0x1p-500')

0 commit comments

Comments
 (0)