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, the result is the integer value that is even. Special cases:

Parameters:
a    a double value.

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