circuitpython/tests/micropython/smallint_intbig.py
Jeff Epler c68d8ac358 tests: Test that operations return small ints.
Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-08-27 14:12:07 -05:00

16 lines
273 B
Python

import struct
import array
zero = 0
i = struct.unpack("Q", b"\0" * 8)[0]
print(i is zero)
i = struct.unpack("q", b"\0" * 8)[0]
print(i is zero)
i = array.array("Q", [0])[0]
print(i is zero)
i = array.array("q", [0])[0]
print(i is zero)
i = pow(3, 3, 3)
print(i is zero)