Determine the subsequent floating-point number that is higher than various given numbers.
System. |
The nextUp()
method in Java retrieves the floating-point number adjacent to a given number in the positive direction, specifically the lowest possible floating-point number that is greater than the starting number.
For double type arguments, the returned value will be closer to the starting number than for float type arguments.
One of the following:
public static double nextUp(double start)
|
public static float nextUp(float start)
|
Parameter |
Description |
start |
Please provide the starting number. |
Returns: |
A double or float value representing the floating-point number that is adjacent to a starting number in the positive direction. |
Java Version: |
1.6+ |