Skip to contents

Element-wise arithmetic right bit shift.

Usage

prim_shift_right_arithmetic(lhs, rhs)

Arguments

lhs, rhs

(arrayish)
Two inputs of the same data type and shape. Can be any integer data type. R values assume the other operand's data type when it is in their data type category, and their default data type when neither operand has one.

Value

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

Implemented Rules

  • stablehlo

  • reverse

StableHLO

Lowers to hlo_shift_right_arithmetic(), specified under shift_right_arithmetic.

Examples

# two R values: both take an R integer's default data type
prim_shift_right_arithmetic(-32L, 2L)
#> AnvlArray
#>  -8
#> [ CPUi32{} ] 

# the R value is built at the array's data type instead
prim_shift_right_arithmetic(-32L, nv_scalar(2L, "i64"))
#> AnvlArray
#>  -8
#> [ CPUi64{} ]