Skip to contents

Element-wise remainder. This differs from base R's %%, use nv_mod()/%% instead.

Usage

nv_remainder(lhs, rhs)

Arguments

lhs, rhs

(arrayish)
Left and right operand. Operands are promoted to a common data type. Scalars are broadcast to the shape of the other operand.

Value

arrayish
Has the same shape and the promoted common data type of the inputs.

See also

nv_mod() for the flooring remainder, prim_remainder() for the underlying primitive.

Examples

x <- nv_array(c(7, 8, 9))
y <- nv_array(c(3, 3, 4))
nv_remainder(x, y)
#> AnvlArray
#>  1
#>  2
#>  1
#> [ CPUf32{3} ]