Return the lesser adjacent of a double in Java
Description
The following code shows how to return the lesser adjacent of a double.
Example
//w w w.j a v a2 s . c om
public class Main {
public static void main(String[] args) {
//
double lesserAdjacent = Math.nextAfter(123.0, 120.0);
System.out.println("Math.nextAfter (123.0, 120.0) = " + lesserAdjacent);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »