Example usage for java.lang StrictMath nextAfter

List of usage examples for java.lang StrictMath nextAfter

Introduction

In this page you can find the example usage for java.lang StrictMath nextAfter.

Prototype

public static float nextAfter(float start, double direction) 

Source Link

Document

Returns the floating-point number adjacent to the first argument in the direction of the second argument.

Usage

From source file:Main.java

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));
}

From source file:Main.java

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));
}