Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xplore
See also: ceil floor rint

Quantlet: 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

Example:

library("xplore")

x = (-3:3)/7

(x ~ round (x, 2)) | (round (131, -1) ~ round (131, -2))

Result:



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

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: TTK, 970713
(C) MD*TECH Method and Data Technologies, 21.9.2000