summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/complex1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/float/complex1.py')
-rw-r--r--tests/float/complex1.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/float/complex1.py b/tests/float/complex1.py
index 7f0b317b35..8544105453 100644
--- a/tests/float/complex1.py
+++ b/tests/float/complex1.py
@@ -53,6 +53,10 @@ print(type(hash(1j)))
# float on lhs should delegate to complex
print(1.2 + 3j)
+# negative base and fractional power should create a complex
+ans = (-1) ** 2.3; print("%.5g %.5g" % (ans.real, ans.imag))
+ans = (-1.2) ** -3.4; print("%.5g %.5g" % (ans.real, ans.imag))
+
# check printing of inf/nan
print(float('nan') * 1j)
print(float('inf') * (1 + 1j))