micropython/tests/basics/int_bytes_long.py
Paul Sokolovsky 3b09dca046 tests: Add test for int.from_bytes() for arbitrary-precision integer.
This test works only for MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_MPZ
and needs a way of skipping in other cases.
2017-01-21 20:15:31 +03:00

8 lines
138 B
Python

b = bytes(range(20))
il = int.from_bytes(b, "little")
ib = int.from_bytes(b, "big")
print(il)
print(ib)
print(il.to_bytes(20, "little"))