diff options
author | Rachel Dowdall <rjdowdall@gmail.com> | 2014-03-22 20:29:56 +0000 |
---|---|---|
committer | Rachel Dowdall <rjdowdall@gmail.com> | 2014-03-22 20:29:56 +0000 |
commit | 2d15deebdcf7d6fb8f78907e0c6ca9cb9c2aa000 (patch) | |
tree | 4dba583967542dd95ebdf3f62865f9bb56db2350 /tests/basics/modulo.py | |
parent | cde8631f15db9941986f8d04534e52462a76094b (diff) | |
download | micropython-2d15deebdcf7d6fb8f78907e0c6ca9cb9c2aa000.tar.gz micropython-2d15deebdcf7d6fb8f78907e0c6ca9cb9c2aa000.zip |
Fixed floor division on mp ints and small ints. Added a floordivide test case.
Diffstat (limited to 'tests/basics/modulo.py')
-rw-r--r-- | tests/basics/modulo.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/basics/modulo.py b/tests/basics/modulo.py index ce7ed2578c..4d83db6ec8 100644 --- a/tests/basics/modulo.py +++ b/tests/basics/modulo.py @@ -1,5 +1,5 @@ # check modulo matches python definition - +# This test compiler version print(123 % 7) print(-123 % 7) print(123 % -7) @@ -7,7 +7,6 @@ print(-123 % -7) a = 321 b = 19 - print(a % b) print(a % -b) print(-a % b) @@ -21,3 +20,17 @@ print(a % b) print(a % -b) print(-a % b) print(-a % -b) + +if False: + print(1.23456 % 0.7) + print(-1.23456 % 0.7) + print(1.23456 % -0.7) + print(-1.23456 % -0.7) + + a = 1.23456 + b = 0.7 + print(a % b) + print(a % -b) + print(-a % b) + print(-a % -b) + |