summaryrefslogtreecommitdiff
path: root/tests/basics/int_big_mul.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-04-04 22:05:30 +0100
committerDamien George <damien.p.george@gmail.com>2015-04-04 22:05:30 +0100
commit9dd36404646f857c4f250537bac0d9a8ad041d25 (patch)
treec6509bcd3c7d5c2e67332110c582df2b5a5c669f /tests/basics/int_big_mul.py
parent7e758b1cf878312cab5d9d2825b36e7235ea10a3 (diff)
tests: Add missing tests for builtins, and many other things.
Diffstat (limited to 'tests/basics/int_big_mul.py')
-rw-r--r--tests/basics/int_big_mul.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/basics/int_big_mul.py b/tests/basics/int_big_mul.py
index f8d3dcd80..6010075c4 100644
--- a/tests/basics/int_big_mul.py
+++ b/tests/basics/int_big_mul.py
@@ -6,3 +6,18 @@ for rhs in range(2, 11):
print(lhs, '*', rhs, '=', res)
lhs = res
+# below tests pos/neg combinations that overflow small int
+
+# 31-bit overflow
+i = 1 << 20
+print(i * i)
+print(i * -i)
+print(-i * i)
+print(-i * -i)
+
+# 63-bit overflow
+i = 1 << 40
+print(i * i)
+print(i * -i)
+print(-i * i)
+print(-i * -i)