From 8a39e18f5fc960eb0901b8e219b7026ebe466f3d Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 3 Feb 2017 00:04:13 +1100 Subject: tests/float: Add tests for zero to a negative power. --- tests/float/complex1.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/float/complex1.py') diff --git a/tests/float/complex1.py b/tests/float/complex1.py index fed65d5d54..1031111f37 100644 --- a/tests/float/complex1.py +++ b/tests/float/complex1.py @@ -28,6 +28,7 @@ print(1j / 2) print((1j / 2j).real) print(1j / (1 + 2j)) ans = 0j ** 0; print("%.5g %.5g" % (ans.real, ans.imag)) +ans = 0j ** 1; print("%.5g %.5g" % (ans.real, ans.imag)) ans = 0j ** 0j; print("%.5g %.5g" % (ans.real, ans.imag)) ans = 1j ** 2.5; print("%.5g %.5g" % (ans.real, ans.imag)) ans = 1j ** 2.5j; print("%.5g %.5g" % (ans.real, ans.imag)) @@ -94,6 +95,10 @@ except ZeroDivisionError: print("ZeroDivisionError") # zero division via power +try: + 0j ** -1 +except ZeroDivisionError: + print("ZeroDivisionError") try: 0j ** 1j except ZeroDivisionError: -- cgit v1.2.3