Skip to contents

Element-wise truncation (round toward zero). You can also use trunc().

Usage

nv_trunc(x)

Arguments

x

(arrayish)
Input array.

Value

arrayish
Has the same shape and data type as the input.

Examples

x <- nv_array(c(1.2, 2.7, -1.5))
trunc(x)
#> AnvlArray
#>   1
#>   2
#>  -1
#> [ CPUf32{3} ]