popCount

popCount, function

def const dash pure popCount(set: long): number

Returns the number of elements in the 64-set set, also known as the population count (number of bits set to 1).

Example

ABC = union(flag(1), union(flag(2), flag(3)))

show scalar "Count" with popCount(ABC)

This outputs the following scalar:

Count
3

Remarks

The returned value ranges from 0 (empty set) to 64 (full set).

User Contributed Notes
0 notes + add a note