bit_count(i)
Return the number of bits set in the integer i
.
For nonnegative inputs, bit_count
will return the number of bits set in the two's complement
representation of i
. For negative inputs, it returns a negative number whose magnitude
is one greater than the number of bits not set in the two's complement representation of i
.
bit_count(5)
// 2