micropython/tests/basics/int_big_add.py

12 wiersze
202 B
Python
Czysty Zwykły widok Historia

# 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)