Java Math floorMod() Method

Facebooktwitterredditpinterestlinkedinmailby feather

The floorMod() method of Math class returns the floor modulus of the specified arguments. It firstly divides the dividend and divisor and then returns an integer that is equal to the remainder.

Syntax:

  1. public static int floorMod (int x, int y)
  2. public static long floorMod (long x, int y)
  3. public static long floorMod (long x, long y)

Parameters:

The parameter ‘x’ and ‘y’ represents the dividend and the divisor.

Return Value:

The floorMod () method returns the floor modulus.

Example 1:

Output:

Example 2:

Output:

Example 3:

Output:

Example 4:

Output:

Facebooktwitterredditpinterestlinkedinmailby feather