Count the set bits of every element.
Numeric.bit.count(value)Counts the active bits in each nested entry.
- Parameters:
value: Scalar, vector, or matrix values to inspect
- Returns: Bit counts matching the input nesting shape
- NumPy: Equivalent to
np.bitwise_count.
import Numeric from '@neabyte/numerix'
const counts = Numeric.bit.count([7, 8])
console.log(counts)
// [3,1]import Numeric from '@neabyte/numerix'
const count = Numeric.bit.count(7)
console.log(count)
// 3import Numeric from '@neabyte/numerix'
const counts = Numeric.bit.count([[7, 8]])
console.log(counts)
// [[3,1]]import Numeric from '@neabyte/numerix'
const count = Numeric.bit.count(0)
console.log(count)
// 0