Math.nextAfter : Floating Point Number « JDK 6 « Java






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

        








Related examples in the same category

1.Math.scalb
2.Math.getExponent
3.Math.nextUp
4.Math.copySign