Provide functions for the manipulation of integers.
pyrr.integer.
count_bits
Counts the number of bits set to 1 in an integer.
For example:
>>> count_bits(0b101111) 5 >>> count_bits(0xf) 4 >>> count_bits(8) 1 >>> count_bits(3) 2
See also
http://wiki.python.org/moin/BitManipulation