diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-19 17:41:01 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-19 17:41:01 +0000 |
commit | 5f7e8dc176661b49e12a0d8425101799ff176d19 (patch) | |
tree | 0fd3daa844300d62a3836b5bb16c3c7be2b875cb /tests/basics/int-small.py | |
parent | b2ebb161d494864cdbee05ee8b74a775845e238e (diff) | |
parent | db796ef84d1737edc4ee44f1b53ff0c1fddb349c (diff) | |
download | micropython-5f7e8dc176661b49e12a0d8425101799ff176d19.tar.gz micropython-5f7e8dc176661b49e12a0d8425101799ff176d19.zip |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'tests/basics/int-small.py')
-rw-r--r-- | tests/basics/int-small.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/basics/int-small.py b/tests/basics/int-small.py new file mode 100644 index 0000000000..be338c4a4c --- /dev/null +++ b/tests/basics/int-small.py @@ -0,0 +1,26 @@ +# This test small int range for 32-bit machine + +a = 0x3fffff +print(a) +a *= 0x10 +print(a) +a *= 0x10 +print(a) +a += 0xff +print(a) +# This would overflow +#a += 1 + +a = -0x3fffff +print(a) +a *= 0x10 +print(a) +a *= 0x10 +print(a) +a -= 0xff +print(a) +# This still doesn't overflow +a -= 1 +print(a) +# This would overflow +#a -= 1 |