Skip to contents

Element-wise rounding. You can also use the round() generic.

Usage

nv_round(operand, method = "nearest_even")

Arguments

operand

(arrayish)
Operand.

method

(character(1))
Rounding method. Either "nearest_even" (default) or "afz" (away from zero).

Value

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

See also

prim_round() for the underlying primitive.

Examples

x <- nv_array(c(1.4, 2.5, 3.6))
round(x)
#> AnvlArray
#>  1
#>  2
#>  4
#> [ CPUf32{3} ]