Rounds a number to the nearest whole number, as specified by Section 5.5 of the IEEE 754 standard.
[Visual Basic] Public Shared Function Round( _ ByVal a As Double _ ) As Double [C#] public static double Round( double a ); [C++] public: static double Round( double a ); [JScript] public static function Round( a : double ) : double;
Returns the nearest whole number. If a is exactly halfway between two whole numbers, this method returns the even whole number.
According to IEEE 754, the default rounding direction is round towards nearest. This means that when the mathematical result of an operation lies halfway between two representable numbers, the one nearest to the mathematical result is delivered as the result. If the mathematical result lies halfway between the two representable numbers, then round to nearest mode specifies round to the nearest even number (final bit is zero.)
Math.Rint (0.5) returns (double) 0. Math.Rint (1.67) returns (double) 2. Math.Rint (5.34) returns (double) 5.