Skip to contents

Element-wise floor.

Usage

prim_floor(x)

Arguments

x

(arrayish)
One input. Can be any float data type. An R value materializes at its default data type.

Value

(arrayish)
Has the input's shape and data type.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to hlo_floor(), specified under floor.

See also

Examples

# the input's data type carries through
x <- nv_array(c(1.2, 2.7, -1.5))
prim_floor(x)
#> AnvlArray
#>   1
#>   2
#>  -2
#> [ CPUf32{3} ] 

# an R value materializes at its default data type
prim_floor(1.2)
#> AnvlArray
#>  1
#> [ CPUf32{} ]