bitCount

bitCount

> Functions

Returns the number of bits set to 1 in the binary representation of the integer x (its Hamming weight). The count covers the 64 bits of a signed integer: a negative number has its sign bit at 1, and bitCount(-1) returns 64 since all its bits are at 1. The function also works on big integers, without the 64-bit limit; for a negative big integer, the bits at 0 are counted instead (bitCount(-1L) returns 0).

Parameters
Return
Note