mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-31373: remove overly strict float range checks (#3486)
This undoes a853a8ba78
except for the pytime.c
parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be
rounded into finite floats. Tests were added to very this behavior.
This commit is contained in:
parent
252033d50e
commit
2bb69a5b4e
4 changed files with 14 additions and 6 deletions
|
@ -377,6 +377,12 @@ class Float_TestCase(unittest.TestCase):
|
|||
r = getargs_f(NAN)
|
||||
self.assertNotEqual(r, r)
|
||||
|
||||
@support.requires_IEEE_754
|
||||
def test_f_rounding(self):
|
||||
from _testcapi import getargs_f
|
||||
self.assertEqual(getargs_f(3.40282356e38), FLT_MAX)
|
||||
self.assertEqual(getargs_f(-3.40282356e38), -FLT_MAX)
|
||||
|
||||
def test_d(self):
|
||||
from _testcapi import getargs_d
|
||||
self.assertEqual(getargs_d(4.25), 4.25)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue