circuitpython/tests/basics/int_longint_bytes.py
2024-09-05 14:54:18 -04:00

10 lines
393 B
Python

# CIRCUITPY-CHANGE: micropython does not have this test file
# Skip if long ints are not supported.
import skip_if
skip_if.no_bigint()
print((2**64).to_bytes(9, "little"))
print((-2**64).to_bytes(9, "little", signed=True))
print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little"))
print(int.from_bytes(b"\x01\0\0\0\0\0\0\0", "little"))
print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little"))