Skip to contents

Element-wise population count (number of set bits).

Usage

nv_popcnt(operand)

Arguments

operand

(arrayish)
Operand.

Value

arrayish
Has the same shape and data type as the input.

See also

prim_popcnt() for the underlying primitive.

Examples

x <- nv_array(c(7L, 3L, 15L))
nv_popcnt(x)
#> AnvlArray
#>  3
#>  2
#>  4
#> [ CPUi32{3} ]