2016-12-21 03:47:02 +00:00
|
|
|
# tests transition from small to large int representation by addition
|
|
|
|
|
|
|
|
# 31-bit overflow
|
|
|
|
i = 0x3fffffff
|
|
|
|
print(i + i)
|
|
|
|
print(-i + -i)
|
|
|
|
|
2018-04-04 15:59:49 +01:00
|
|
|
# 47-bit overflow
|
|
|
|
i = 0x3fffffffffff
|
|
|
|
print(i + i)
|
|
|
|
print(-i + -i)
|
|
|
|
|
2016-12-21 03:47:02 +00:00
|
|
|
# 63-bit overflow
|
|
|
|
i = 0x3fffffffffffffff
|
|
|
|
print(i + i)
|
|
|
|
print(-i + -i)
|