Math.floor()
Java Math.floor() method
Last Updated : 17 Mar 2025
The java.lang.Math.floor() is used to find the largest integer value which is less than or equal to the argument and is equal to the mathematical integer of a double value.
Syntax
Parameter
Return
- If the argument is positive or negative double value, this method will return the Floor value.
- If the argument is NaN, this method will return same argument.
- If the argument is Infinity, this method will return Infinity with same sign as the argument.
Example 1
Output:
Example 2
Output:
Example 3
Output:
Example 4
Output: