86
Java Math.floor() method
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:
94.0
Example 2
Output:
-40.0
Example 3
Output:
0.0
Example 4
Output:
-Infinity
Next TopicJava Math