public static double rint (double a)

Returns the double value that is closest in value to the argument and is equal to a mathematical integer. If two double values that are mathematical integers are equally close to the value of the argument, the result is the integer value that is even. Special cases:

Parameters:
a    a value.

Returns:  the closest floating-point value to a that is equal to a mathematical integer.