summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_complex.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2008-01-31 22:17:37 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2008-01-31 22:17:37 (GMT)
commit105be7725b88ecef826ac07392a4236bae934bf6 (patch)
tree7975fc1a3f2b5f982c4ee87ddd360f53922c2d2e /Lib/test/test_complex.py
parent2df20a3e0816537db68618cef0603e89773beac4 (diff)
downloadcpython-105be7725b88ecef826ac07392a4236bae934bf6.zip
cpython-105be7725b88ecef826ac07392a4236bae934bf6.tar.gz
cpython-105be7725b88ecef826ac07392a4236bae934bf6.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r--Lib/test/test_complex.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index 64297e2..bd3890e 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -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)