Vocabularymath.bitwiseInputsOutputsWord descriptionReturns the number of set bits as an object. This word only works on non-negative integers or objects that can be represented as a byte-array.
ExamplesUSING: math.bitwise prettyprint ;
0xf0 bit-count .
4
USING: math.bitwise prettyprint ;
-1 32 bits bit-count .
32
USING: math.bitwise prettyprint ;
B{ 1 0 1 } bit-count .
2
DefinitionMethods