Skip to contents

Element-wise remainder. Result has sign of the divident, which differs from base R's %%, which is available via nv_mod() and has sign of divisor.

Usage

prim_remainder(lhs, rhs)

Arguments

lhs, rhs

(arrayish)
Arrayish values of data type integer, unsigned integer, or floating-point. Must have the same shape.

Value

arrayish
Has the same shape and data type as the inputs. It is ambiguous if both inputs are ambiguous.

Implemented Rules

  • stablehlo

  • reverse

StableHLO

Lowers to stablehlo::hlo_remainder().

See also

Examples

prim_remainder(1, -3)
#> AnvlArray
#>  1
#> [ CPUf32?{} ] 
1 %% -3
#> [1] -2