Example usage for java.lang StrictMath getExponent

List of usage examples for java.lang StrictMath getExponent

Introduction

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

Prototype

public static int getExponent(double d) 

Source Link

Document

Returns the unbiased exponent used in the representation of a double .

Usage

From source file:Main.java

public static void main(String[] args) {

    float f1 = 25, f2 = 1024;

    System.out.println("Exponent value of " + f1 + " = " + StrictMath.getExponent(f1));

    System.out.println("Exponent value of " + f2 + " = " + StrictMath.getExponent(f2));
}

From source file:Main.java

public static void main(String[] args) {

    double d1 = 16.2, d2 = 512.3;

    // returns the unbiased exponent used in the representation of a double
    double exponentValue = StrictMath.getExponent(d1);
    System.out.println("Exponent value of " + d1 + " = " + exponentValue);

    exponentValue = StrictMath.getExponent(d2);
    System.out.println("Exponent value of " + d2 + " = " + exponentValue);
}