You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
27 lines
315 B
Python
27 lines
315 B
Python
# This tests small int range for 32-bit machine
|
|
|
|
a = 0x3fffff
|
|
print(a)
|
|
a *= 0x10
|
|
print(a)
|
|
a *= 0x10
|
|
print(a)
|
|
a += 0xff
|
|
print(a)
|
|
# This would overflow
|
|
#a += 1
|
|
|
|
a = -0x3fffff
|
|
print(a)
|
|
a *= 0x10
|
|
print(a)
|
|
a *= 0x10
|
|
print(a)
|
|
a -= 0xff
|
|
print(a)
|
|
# This still doesn't overflow
|
|
a -= 1
|
|
print(a)
|
|
# This would overflow
|
|
#a -= 1
|