round

round -- rounds a real number up or down to the nearest integer.

Syntax

round (number)

		

Arguments

number

A number.

Returns

The nearest integer to the number.

Description

This function rounds its argument to the nearest integer. Values of .5 are rounded up to the next highest integer.

Example

    Gamma> round(8.73);
    9
    Gamma> round(2.21);
    2
    Gamma> round(5.5);
    6
    Gamma> round(5.49);
    5
    Gamma>  
    		

See the QNX 6-specific Function section of the Photon Functions chapter (Tutorial One) in the Cogent Tools Demo and Tutorials book for an example of this function used in context.

See Also

ceil, floor

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.