Java StrictMath.nextAfter(float start, double direction)

Syntax

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

public static float nextAfter(float start,  double direction)

Example

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


/*from   w ww  .j  av a 2s . c  om*/
public class Main {

  public static void main(String[] args) {
  
    float f1 = 12.3f, f2 = 0.0f;
       
    System.out.println(StrictMath.nextAfter(f1, 9.2d));

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

    System.out.println(StrictMath.nextAfter(f2, 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