[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

anon report at bugs.python.org
Sat Dec 7 16:16:28 CET 2013


anon added the comment:

I didn't really consider floats. bit_length() is only provided to ints for example.

I think a better solution to pick apart floats would be a function similar to math.frexp, if it isn't already sufficient. float.bits_at(pos, width) seems a worse solution because the position of each bit would be arbitrary. But I have no major objection against it being extended to floats.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19915>
_______________________________________


More information about the Python-bugs-list mailing list