summaryrefslogtreecommitdiff
path: root/tests/float/complex1.py
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2015-05-13 21:35:58 +0200
committerDamien George <damien.p.george@gmail.com>2015-05-13 23:10:15 +0100
commit709955b601a0b7de7a85e91d97846660979904a7 (patch)
tree5231c4afdc5879dbf52bd489d0861175a468493c /tests/float/complex1.py
parent1db3577bcb7ff6016c7a938e502ba49f7e52419f (diff)
py: Fix printing of complex number when imaginary part is nan
Diffstat (limited to 'tests/float/complex1.py')
-rw-r--r--tests/float/complex1.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/float/complex1.py b/tests/float/complex1.py
index 239527109..ebe4b0f37 100644
--- a/tests/float/complex1.py
+++ b/tests/float/complex1.py
@@ -43,6 +43,11 @@ print("%.5g" % abs(1j + 2))
# float on lhs should delegate to complex
print(1.2 + 3j)
+# check printing of inf/nan
+print(float('nan') * 1j)
+print(float('inf') * (1 + 1j))
+print(float('-inf') * (1 + 1j))
+
# convert bignum to complex on rhs
ans = 1j + (1 << 70); print("%.5g %.5g" % (ans.real, ans.imag))