circuitpython/tests/basics/bit_length.py

5 lines
183 B
Python
Raw Normal View History

for i in range(129):
j = (1 << i)
print(i, (j-1).bit_length(), (j).bit_length(), (j+1).bit_length())
print(i, (-j-1).bit_length(), (-j).bit_length(), (-j+1).bit_length())