NAME
    round - round a value to a specified number of decimal places

SYNOPSIS
    round(x [,j])

TYPES
    x		real, complex, matrix, object (calls xx_round)
    j		integer

    return	for real x, real
		for complex x, real or complex
		for matrix, matrix of same dimension with same limits
		for object, any

DESCRIPTION
    For real x, returns n * 10^-j, where n is the integer for which
    -(10^-j)/2 < (n * 10^-j - x) * sgn(x) <= (10^-j)/2.  That is,
    round(x, j) rounds x to j decimal places, with rounding away from
    zero in ambiguous cases.    

    The default value of j is 0.

    If j = 0, the rounding is to the nearest integer, or when x - 1/2
    is an integer, to the nearest integer with larger absolute value.

    If x is complex, the real and imaginary parts are rounded as for real x;
    if the imaginary part rounds to zero, the result is real.

    If x is a matrix each of whose elements is roundable, round(x, j)
    returns the matrix whose elements are the results of rounding the
    elements of x.  The returned matrix has the same dimension and the
    same limits as x.

    If x is an object of type xx and xx_round(a,b) has been defined,
    round(x,j) will be the result for xx_round(x,j).

EXAMPLE
    Assuming epsilon() = 1e-20:
    > print round(pi()), round(pi(), 5), round(sqrt(-3), 8)
    3 3.14159 1.73205081i

    > print round(3.333), round(3.789), round(3.333, 2), round(3.789, 2)
    3 4 3.33 3.79

    > print round(-3.333), round(-3.789), round(-3.333, 2), round(-3.789, 2)
    -3 -4 -3.33 -3.79

    > print round(3.5), round(-2.5), round(1.5675, 3)
    4 -3 1.568

LIMITS
    0 <= j < 2^31

LIBRARY
    void roundvalue(VALUE *x, *j, *vres)

SEE ALSO
    bround, btrunc, int, trunc
