Example usage for java.lang StrictMath scalb

List of usage examples for java.lang StrictMath scalb

Introduction

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

Prototype

public static float scalb(float f, int scaleFactor) 

Source Link

Document

Returns f × 2 scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set.

Usage

From source file:Main.java

public static void main(String[] args) {

    double d1 = 1.2, d2 = 3.4, d3 = 0.0;
    int power = 2;

    System.out.println(StrictMath.scalb(d1, power));

    System.out.println(StrictMath.scalb(d2, power));

    System.out.println(StrictMath.scalb(d3, power));
}

From source file:Main.java

public static void main(String[] args) {

    float f1 = 5.0f, f2 = 1.23f, f3 = 0.0f;
    int power = 2;

    System.out.println(StrictMath.scalb(f1, power));

    System.out.println(StrictMath.scalb(f2, power));

    System.out.println(StrictMath.scalb(f3, power));
}