You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
202 B
12 lines
202 B
8 years ago
|
# tests transition from small to large int representation by addition
|
||
|
|
||
|
# 31-bit overflow
|
||
|
i = 0x3fffffff
|
||
|
print(i + i)
|
||
|
print(-i + -i)
|
||
|
|
||
|
# 63-bit overflow
|
||
|
i = 0x3fffffffffffffff
|
||
|
print(i + i)
|
||
|
print(-i + -i)
|