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)

Arguments

lhs, rhs

(arrayish)
Two inputs with a common data type. Can be any numeric 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

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} ]