tests/int_big_*: Add more tests for result normalization.
Tested by comparability to small int/casting to bool.
This commit is contained in:
parent
b3be4710aa
commit
4120f32292
@ -6,3 +6,4 @@ a = 0xfffffffffffffffffffffffffffff
|
||||
print(a ^ (1 << 100))
|
||||
print(a ^ (1 << 200))
|
||||
print(a ^ a == 0)
|
||||
print(bool(a ^ a))
|
||||
|
@ -1,6 +1,7 @@
|
||||
# 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user