Skip to contents

Element-wise logical right bit shift.

Usage

nv_shift_right_logical(lhs, rhs)

Arguments

lhs, rhs

(arrayish)
Two inputs with a common data type. Can be any integer data type. Scalars are broadcast, and R values assume the other operand's data type within their data type category, otherwise falling back to their default data type and being converted to the common data type.

Value

(arrayish)
Has the inputs' broadcast shape and common data type.

See also

prim_shift_right_logical() for the underlying primitive.

Examples

x <- nv_array(c(8L, 16L, 32L))
y <- nv_array(c(1L, 2L, 3L))
nv_shift_right_logical(x, y)
#> AnvlArray
#>  4
#>  4
#>  4
#> [ CPUi32{3} ] 

# different data types are promoted to their common one
nv_shift_right_logical(nv_scalar(32L, "i32"), nv_scalar(2L, "i64"))
#> AnvlArray
#>  8
#> [ CPUi64{} ] 

# a scalar is broadcast
nv_shift_right_logical(x, 1L)
#> AnvlArray
#>   4
#>   8
#>  16
#> [ CPUi32{3} ]