round
Returns the closest int to the argument, with ties rounding to positive infinity.
Special cases:
If the argument is NaN, the result is 0.
If the argument is negative infinity or any value less than or equal to the value of
Integer.MIN_VALUE, the result is equal to the value ofInteger.MIN_VALUE.If the argument is positive infinity or any value greater than or equal to the value of
Integer.MAX_VALUE, the result is equal to the value ofInteger.MAX_VALUE.
Return
the value of the argument rounded to the nearest int value.
Parameters
a floating-point value to be rounded to an integer.
See also
Returns the closest long to the argument, with ties rounding to positive infinity.
Special cases:
If the argument is NaN, the result is 0.
If the argument is negative infinity or any value less than or equal to the value of
Long.MIN_VALUE, the result is equal to the value ofLong.MIN_VALUE.If the argument is positive infinity or any value greater than or equal to the value of
Long.MAX_VALUE, the result is equal to the value ofLong.MAX_VALUE.
Return
the value of the argument rounded to the nearest long value.
Parameters
a floating-point value to be rounded to a long.