Returns the floor modulus of the long
arguments.
The floor modulus is x - (floorDiv(x, y) * y)
,
has the same sign as the divisor y
, and
is in the range of -abs(y) < r < +abs(y)
.
The relationship between floorDiv
and floorMod
is such that:
floorDiv(x, y) * y + floorMod(x, y) == x
See Math.floorMod
for examples and
a comparison to the %
operator.
x | the dividend | |
y | the divisor |
x - (floorDiv(x, y) * y)
ArithmeticException | if the divisor y is zero |
Math.floorMod(long, long), StrictMath.floorDiv(long, long)
Diagram: Math