summaryrefslogtreecommitdiff
path: root/tests/basics/int_longint_bytes.py
blob: 90cbff2f877cfa8e15c538f485335c9806cbf1b3 (plain)
1
2
3
4
5
6
7
8
9
# 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"))