mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #5829: complex('1e500') shouldn't raise OverflowError
This commit is contained in:
parent
e2e1561a15
commit
6b1e43b7bc
3 changed files with 13 additions and 2 deletions
|
@ -407,6 +407,13 @@ class ComplexTest(unittest.TestCase):
|
|||
self.assertEquals(atan2(z1.imag, -1.), atan2(0., -1.))
|
||||
self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.))
|
||||
|
||||
@unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
|
||||
"test requires IEEE 754 doubles")
|
||||
def test_overflow(self):
|
||||
self.assertEqual(complex("1e500"), complex(INF, 0.0))
|
||||
self.assertEqual(complex("-1e500j"), complex(0.0, -INF))
|
||||
self.assertEqual(complex("-1e500+1.8e308j"), complex(-INF, INF))
|
||||
|
||||
@unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
|
||||
"test requires IEEE 754 doubles")
|
||||
def test_repr_roundtrip(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue