Skip to contents

Rounds each element of input to the nearest integer towards zero. Basically the same as trunc()

Usage

fix(X)

Arguments

X

input element

Value

The values of trunc(X).

Author

Waldir Leoncio

Examples

X <- matrix(c(-1.9, -3.4, 1.6, 2.5, -4.5, 4.5), 3, byrow = TRUE)
Y <- matrix(c(-1, -3, 1, 2, -4, 4), 3, byrow = TRUE)
fix(X)
#>      [,1] [,2]
#> [1,]   -1   -3
#> [2,]    1    2
#> [3,]   -4    4
fix(Y)
#>      [,1] [,2]
#> [1,]   -1   -3
#> [2,]    1    2
#> [3,]   -4    4