mirror of
https://github.com/python/cpython.git
synced 2025-09-15 05:06:12 +00:00
Issue #1678380. Fix a bug that identifies 0j and -0j when they appear
in the same code unit. The fix is essentially the same as the fix for a previous bug identifying 0. and -0.
This commit is contained in:
parent
2df20a3e08
commit
105be7725b
3 changed files with 57 additions and 12 deletions
|
@ -359,6 +359,13 @@ class ComplexTest(unittest.TestCase):
|
|||
except (OSError, IOError):
|
||||
pass
|
||||
|
||||
if float.__getformat__("double").startswith("IEEE"):
|
||||
def test_plus_minus_0j(self):
|
||||
# test that -0j and 0j literals are not identified
|
||||
z1, z2 = 0j, -0j
|
||||
self.assertEquals(atan2(z1.imag, -1.), atan2(0., -1.))
|
||||
self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.))
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(ComplexTest)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue