diff options
| author | Glenn Ruben Bakke <glennbakke@gmail.com> | 2017-02-07 22:27:32 +0100 |
|---|---|---|
| committer | Glenn Ruben Bakke <glennbakke@gmail.com> | 2017-02-07 22:27:32 +0100 |
| commit | 122d0430db4d103dfb8bc9958b7df4d9803038c8 (patch) | |
| tree | 856ac0d4950b0154cc6aae8cf022fd29b2402073 /tests/float | |
| parent | 723943abde3e9de5e14ee40df5e0d5fe25352c97 (diff) | |
| parent | 4cf7fd151e98a3d842eb5c9428545cb67ddd57ee (diff) | |
Merge branch 'nrf52' into nrf5_no_sdk
Diffstat (limited to 'tests/float')
| -rw-r--r-- | tests/float/complex1.py | 5 | ||||
| -rw-r--r-- | tests/float/float1.py | 5 | ||||
| -rw-r--r-- | tests/float/int_divzero.py | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/float/complex1.py b/tests/float/complex1.py index fed65d5d5..1031111f3 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)) @@ -95,6 +96,10 @@ except ZeroDivisionError: # zero division via power try: + 0j ** -1 +except ZeroDivisionError: + print("ZeroDivisionError") +try: 0j ** 1j except ZeroDivisionError: print("ZeroDivisionError") diff --git a/tests/float/float1.py b/tests/float/float1.py index 0e115032b..93f6f014c 100644 --- a/tests/float/float1.py +++ b/tests/float/float1.py @@ -75,6 +75,11 @@ try: except ZeroDivisionError: print("ZeroDivisionError") +try: + 0.0 ** -1 +except ZeroDivisionError: + print("ZeroDivisionError") + # unsupported unary ops try: diff --git a/tests/float/int_divzero.py b/tests/float/int_divzero.py index b037dd8c7..b311a1dbc 100644 --- a/tests/float/int_divzero.py +++ b/tests/float/int_divzero.py @@ -2,3 +2,8 @@ try: 1 / 0 except ZeroDivisionError: print("ZeroDivisionError") + +try: + 0 ** -1 +except ZeroDivisionError: + print("ZeroDivisionError") |
