diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-14 22:56:02 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-14 22:56:02 +0000 |
commit | f256cfef4f67c0a79141194b0a28dfa2a21b1110 (patch) | |
tree | 2bbf38e88a62351f4ec42c2e428ae63e78eedf4d /tests/float | |
parent | fa1edff006ced6f2e4b4ba4f899809c0d2a63de0 (diff) | |
download | micropython-f256cfef4f67c0a79141194b0a28dfa2a21b1110.tar.gz micropython-f256cfef4f67c0a79141194b0a28dfa2a21b1110.zip |
tests: Add some more tests for complex numbers and ure module.
Diffstat (limited to 'tests/float')
-rw-r--r-- | tests/float/complex1.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/float/complex1.py b/tests/float/complex1.py index 4cf7a25f6d..6cfbff61bc 100644 --- a/tests/float/complex1.py +++ b/tests/float/complex1.py @@ -13,7 +13,7 @@ print(complex(1j, 2j)) # unary ops print(bool(1j)) print(+(1j)) -#print(-(1j)) uPy doesn't print correctly +print(-(1 + 2j)) # binary ops print(1j + 2) @@ -23,10 +23,10 @@ print(1j - 2j) print(1j * 2) print(1j * 2j) print(1j / 2) -#print(1j / 2j) uPy doesn't print correctly -#print(1j ** 2) uPy doesn't print correctly -#print(1j ** 2j) uPy doesn't print correctly +print(1j / (1 + 2j)) +ans = 1j ** 2.5; print("%.5g %.5g" % (ans.real, ans.imag)) +ans = 1j ** 2.5j; print("%.5g %.5g" % (ans.real, ans.imag)) # builtin abs print(abs(1j)) -print(abs(1j + 2)) +print("%.5g" % abs(1j + 2)) |