public static long floorDiv (long x, long y)

Returns the largest (closest to positive infinity) long value that is less than or equal to the algebraic quotient. There is one special case, if the dividend is the Long.MIN_VALUE and the divisor is -1, then integer overflow occurs and the result is equal to Long.MIN_VALUE.

Normal integer division operates under the round to zero rounding mode (truncation). This operation instead acts under the round toward negative infinity (floor) rounding mode. The floor rounding mode gives different results from truncation when the exact result is negative.

For examples, see floorDiv(int, int).

Parameters:
x    the dividend
y    the divisor

Returns:  the largest (closest to positive infinity) long value that is less than or equal to the algebraic quotient.

Exceptions:
ArithmeticException    if the divisor y is zero

See also:
floorMod(long, long), floor(double)

Since:  1.8