bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math floorMod() Method

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java Math floorMod() Method?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___.out.println(Math.floorMod(10, 4));
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The floorMod() method returns the remainder of a division between two integers where the result of the division was rounded down.
Definition and Usage
Java Math floorMod() Method

❮ Math Methods

Example

System.out.println(Math.floorMod(10, 4));
System.out.println(Math.floorMod(-10, 4));
System.out.println(Math.floorMod(10, 3));
System.out.println(Math.floorMod(-10, 3));

Definition and Usage

The floorMod() method returns the remainder of a division between two integers where the result of the division was rounded down.

Syntax One of the following: public static int floorMod(int dividend , int divisor ) public static long floorMod(long dividend , long divisor ) Parameter Values Parameter Description dividend Required. The dividend of the remainder operation. divisor Required. The divisor of the remainder operation. Technical Details Returns: An int or long value representing the remainder from a division between two integers. Throws: ArithmeticException - If the divisor is zero. Java version: 1.8+ ❮ Math Methods

One of the following

public static int floorMod(int
dividend , int
divisor )
public static long floorMod(long
dividend , long
divisor )

Parameter Values

ParameterDescription
dividendRequired. The dividend of the remainder operation.
divisorRequired. The divisor of the remainder operation.

Technical Details

Returns:An int or long value representing the remainder from a division between two integers.
Throws:ArithmeticException - If the divisor is zero.
Java version:1.8+

Previous

Java Math floorDiv() Method

Next

Java Math getExponent() Method