diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-07-25 11:49:22 +1000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-07-25 11:49:22 +1000 |
| commit | 04552ff71b6c722b21597d93481f024c72457cef (patch) | |
| tree | fdbc66843e079a78cbf964aa6308ab5db78a42d1 /tests/float/int_big_float.py | |
| parent | 4d1fb6107fdedb0dda8dfb1491c033bf731222c6 (diff) | |
py: Implement raising a big-int to a negative power.
Before this patch raising a big-int to a negative power would just return
0. Now it returns a floating-point number with the correct value.
Diffstat (limited to 'tests/float/int_big_float.py')
| -rw-r--r-- | tests/float/int_big_float.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/float/int_big_float.py b/tests/float/int_big_float.py index b1a26ca73..0bd166218 100644 --- a/tests/float/int_big_float.py +++ b/tests/float/int_big_float.py @@ -18,6 +18,10 @@ print("%.5g" % (i / 1.2)) # this should delegate to complex print("%.5g" % (i * 1.2j).imag) +# negative power should produce float +print("%.5g" % (i ** -1)) +print("%.5g" % ((2 + i - i) ** -3)) + try: i / 0 except ZeroDivisionError: |
