100
Java Math.nextDown() method
The java.lang.Math.nextDown() is a built-in math method in java. It returns the floating-point value adjacent to the user specified parameter (d) in the direction of negative infinity. This method is equivalent to nextAfter(d, Double.NEGATIVE_INFINITY) method.
Implementation of nextDown may run faster than its equivalent nextAfter call.
Syntax
Parameter
Return
- If the argument is a NaN, this method will return NaN.
- If the argument is Zero and we are dealing with double, this method will return Double.MIN_VALUE.
- If the argument is Zero and we are dealing with float, this method will return Float.MIN_VALUE.
- If the argument is Negative Infinity, this method will return Negative Infinity.
Example 1
Output:
NaN
Example 2
Output:
744.9299999999998
Example 3
Output:
328.69998
Example 4
Output:
-1.4E-45
Example 5
Output:
-4.9E-324
Example 6
Output:
-Infinity
Next TopicJava Math