diff options
Diffstat (limited to 'tests/float')
-rw-r--r-- | tests/float/complex1.py | 5 | ||||
-rw-r--r-- | tests/float/float1.py | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/float/complex1.py b/tests/float/complex1.py index a6038de04a..7f0b317b35 100644 --- a/tests/float/complex1.py +++ b/tests/float/complex1.py @@ -37,6 +37,11 @@ ans = 1j ** 2.5j; print("%.5g %.5g" % (ans.real, ans.imag)) print(1j == 1) print(1j == 1j) +# comparison of nan is special +nan = float('nan') * 1j +print(nan == 1j) +print(nan == nan) + # builtin abs print(abs(1j)) print("%.5g" % abs(1j + 2)) diff --git a/tests/float/float1.py b/tests/float/float1.py index 93f6f014c4..137dacc233 100644 --- a/tests/float/float1.py +++ b/tests/float/float1.py @@ -60,6 +60,11 @@ print(1.2 <= -3.4) print(1.2 >= 3.4) print(1.2 >= -3.4) +# comparison of nan is special +nan = float('nan') +print(nan == 1.2) +print(nan == nan) + try: 1.0 / 0 except ZeroDivisionError: |