bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math nextDown() Method

❮ Math Methods

Example

System.out.println(Math.nextDown(1.0f));
System.out.println(Math.nextDown(1.0));
System.out.println(Math.nextDown(0.5f));
System.out.println(Math.nextDown(0.5));
System.out.println(Math.nextDown(Math.PI));
System.out.println(Math.nextDown(3.1415927f));

Definition and Usage

The nextDown() method returns the floating point number adjacent to a number in the negative direction, which is the highest possible floating point number that is less than the starting number. The return value for double type arguments will be closer to the starting number than the return value for float type arguments. Syntax One of the following: public static double nextDown(double start ) public static float nextDown(float start ) Parameter Values Parameter Description start Required. The number to start from. Technical Details Returns: A double or float value representing the floating point number adjacent to a starting number in the negative direction. Java version: 1.8+ ❮ Math Methods

The return value for double type arguments will be closer to the starting number than the return value for float type arguments. Syntax One of the following: public static double nextDown(double start ) public static float nextDown(float start ) Parameter Values Parameter Description start Required. The number to start from. Technical Details Returns: A double or float value representing the floating point number adjacent to a starting number in the negative direction. Java version: 1.8+ ❮ Math Methods

The return value for double type arguments will be closer to the starting number than the return value for float type arguments.

One of the following

public static double nextDown(double
start )
public static float nextDown(float
start )

Parameter Values

ParameterDescription
startRequired. The number to start from.

Technical Details

Returns:A double or float value representing the floating point number adjacent to a starting number in the negative direction.
Java version:1.8+

Previous

Java Math nextAfter() Method

Next

Java Math nextUp() Method