Mega Code Archive

 
Categories / Java / JDK
 

Math nextAfter

public class FloastPointDemo {   public static void main(String[] args) {     // Returns the lesser adjacent of a double     double lesserAdjacent = Math.nextAfter(123.0, 120.0);     System.out.println("Math.nextAfter (123.0, 120.0) = " + lesserAdjacent);   } } // Math.nextAfter (123.0, 120.0) = 122.99999999999999