BitCount

BitCount(n)

Compute the number of bits set to 1 in an integer.

Parameters:
npositive int
Returns:
resultpositive int

Examples

>>> import openturns as ot
>>> int(ot.SpecFunc.BitCount(42))
3