Math.nextDown()

Java Math.nextDown() method

Last Updated : 17 Mar 2025

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:

Example 2

Output:

Example 3

Output:

Example 4

Output:

Example 5

Output:

Example 6

Output: