R/api.R
nv_trunc.Rd
Element-wise truncation (round toward zero). You can also use trunc().
trunc()
nv_trunc(operand)
(arrayish) Operand.
arrayish
arrayish Has the same shape and data type as the input.
nv_floor(), nv_ceiling(), nv_round().
nv_floor()
nv_ceiling()
nv_round()
x <- nv_array(c(1.2, 2.7, -1.5)) trunc(x) #> AnvlArray #> 1 #> 2 #> -1 #> [ CPUf32{3} ]