round Function (Windows CE 5.0)

Send Feedback

Returns an integer closest in value to the argument.

numberround(number)

Parameters

  • number
    A number.

Return Values

Returns an integer closest in value to the argument.

Remarks

If there are two such numbers, the one that is closest to positive infinity is returned. If the argument is NaN, NaN is returned. If the argument is positive infinity, positive infinity is returned. If the argument is negative infinity, negative infinity is returned. If the argument is positive zero, positive zero is returned. If the argument is negative zero, negative zero is returned. If the argument is less than zero but greater than or equal to -0.5, negative zero is returned.

For the last two cases, the result of calling the round() function is not the same as the result of adding 0.5 and then calling the floor() function because positive zero will be returned in such cases.

The following function call returns 3.

round(2.6)

The following function call returns 2.

round (2.4)

The following function call returns 3.

round(2.5)

The following function call returns –2.

round(-1.6)

The following function call returns –1.

round(-1.5)

Requirements

None.

See Also

Number Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.