Skip to contents

Element-wise flooring division. You can also call this via the %/% operator. The result is the largest whole number that does not exceed lhs / rhs.

Usage

nv_floor_div(lhs, rhs)

# S3 method for class 'AnvlArray'
e1%/%e2

Arguments

lhs, rhs

(arrayish)
Two inputs with a common data type. Can be any numeric data type. Scalars are broadcast. An R value takes the other operand's data type when that is in its own or a higher category. Otherwise it settles on its default data type, and the operands meet at their common data type.

e1, e2

(arrayish)
The operands of the operator, which it passes on as lhs and rhs.

Value

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

See also

nv_mod() for the matching remainder, nv_div() for the division itself.

Examples

x <- nv_array(c(7L, -7L))
y <- nv_array(c(2L, 2L))
nv_floor_div(x, y)
#> AnvlArray
#>   3
#>  -4
#> [ CPUi32{2} ] 
x %/% y
#> AnvlArray
#>   3
#>  -4
#> [ CPUi32{2} ]