Skip to content

popCount64

popCount64(value): number

Defined in: packages/core/src/big-int/bit/pop-count64.ts:13

Counts the set bits in the low 64 bits of value (Hamming weight).

The 64-bit counterpart of popcount32: the same SWAR reduction with bigint masks and a final byte-sum multiply instead of a loop.

bigint

The value to count; only its low 64 bits are considered.

number

The number of set bits, from 0 to 64.