| Library: | xplore |
| See also: | ceil floor rint |
| Macro: | round | |
| Description: | Rounds to a given precision. If the precision is omitted the nearest integer is given back. |
| Usage: | y = round (x{, n}) | |
| Input: | ||
| x | array, values which should be rounded | |
| n | optional, number of digits for rounding | |
| Output: | ||
| y | array, integers of x | |
library("xplore")
x = (-3:3)/7
(x ~ round (x, 2)) | (round (131, -1) ~ round (131, -2))
Contenst of _tmp [1,] -0.42857 -0.43 [2,] -0.28571 -0.29 [3,] -0.14286 -0.14 [4,] 0 0 [5,] 0.14286 0.14 [6,] 0.28571 0.29 [7,] 0.42857 0.43 [8,] 100 130
| Library: | xplore |
| See also: | ceil floor rint |