Commit 4120f322 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests/int_big_*: Add more tests for result normalization.

Tested by comparability to small int/casting to bool.
parent b3be4710
......@@ -6,3 +6,4 @@ a = 0xfffffffffffffffffffffffffffff
print(a ^ (1 << 100))
print(a ^ (1 << 200))
print(a ^ a == 0)
print(bool(a ^ a))
# to test arbitrariy precision integers
x = 1000000000000000000000000000000
xn = -1000000000000000000000000000000
y = 2000000000000000000000000000000
# printing
......@@ -10,11 +11,15 @@ print(y)
# addition
print(x + 1)
print(x + y)
print(x + xn == 0)
print(bool(x + xn))
# subtraction
print(x - 1)
print(x - y)
print(y - x)
print(x - x == 0)
print(bool(x - x))
# multiplication
print(x * 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment