Return the greater adjacent of a double in Java
Description
The following code shows how to return the greater adjacent of a double.
Example
//from www . j a v a 2 s . com
public class Main {
public static void main(String[] args) {
// Returns the greater adjacent of a double
double greaterAdjacent = Math.nextUp(123.0);
System.out.println("Math.nextUp (123.0) = " + greaterAdjacent);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »