ben.fisher
owner
July 2, 2010
In Python 2.7 and 3.1, numbers have
a .bit_length() method.
>>> n = 37
>>> bin(n)
'0b100101'
>>> n.bit_length()
6
New Comment...
To add a comment, send an email to
<
[email protected]
>
with the subject "bit-packing-preprocessor".
a .bit_length() method.
>>> n = 37
>>> bin(n)
'0b100101'
>>> n.bit_length()
6