mirror of
https://github.com/python/cpython.git
synced 2025-08-08 19:09:46 +00:00
[3.14] gh-132876: workaround broken ldexp() on Windows 10 (GH-133135) (#134684)
gh-132876: workaround broken ldexp() on Windows 10 (GH-133135)
* gh-132876: workaround broken ldexp() on Windows 10
ldexp() fails to round subnormal results before Windows 11,
so hide their bug.
(cherry picked from commit cf8941c603
)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Tim Peters <tim.peters@gmail.com>
This commit is contained in:
parent
7216f7b59c
commit
16187b58bf
3 changed files with 31 additions and 0 deletions
|
@ -1214,6 +1214,12 @@ class MathTests(unittest.TestCase):
|
|||
self.assertEqual(math.ldexp(NINF, n), NINF)
|
||||
self.assertTrue(math.isnan(math.ldexp(NAN, n)))
|
||||
|
||||
@requires_IEEE_754
|
||||
def testLdexp_denormal(self):
|
||||
# Denormal output incorrectly rounded (truncated)
|
||||
# on some Windows.
|
||||
self.assertEqual(math.ldexp(6993274598585239, -1126), 1e-323)
|
||||
|
||||
def testLog(self):
|
||||
self.assertRaises(TypeError, math.log)
|
||||
self.assertRaises(TypeError, math.log, 1, 2, 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue