Provide the remainders resulting from divisions rounded down.
System. |
The floorMod() method computes the remainder of an integer division, where the quotient is rounded down.
The outcome equals to dividend – Math.floorDiv(dividend, divisor) * divisor.
One of the following:
public static int floorMod(int dividend, int divisor ) |
public static long floorMod(long dividend, long divisor) |
Parameter |
Description |
dividend |
Needed: The number to be divided to find the remainder. |
divisor |
Needed: The number by which the dividend is divided to find the remainder. |
Return: |
An int or long value representing the remainder resulting from the division of two integers. |
Throws: |
ArithmeticException is thrown if the divisor is zero. |
Java Version: |
1.8+ |