Java StrictMath.nextAfter(double start, double direction)

Syntax

StrictMath.nextAfter(double start, double direction) has the following syntax.

public static double nextAfter(double start,  double direction)

Example

In the following code shows how to use StrictMath.nextAfter(double start, double direction) method.


/*from  w  w w  .  j  a  v a 2s  . com*/
public class Main {

  public static void main(String[] args) {
  
    double d1 = 123.4d, d2 = 0.0d;
       
    System.out.println(StrictMath.nextAfter(d1, 9.2d));

    System.out.println(StrictMath.nextAfter(d2, 9.2d));

    System.out.println(StrictMath.nextAfter(d2, 0.0d));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable