Example usage for java.lang Math scalb

List of usage examples for java.lang Math scalb

Introduction

In this page you can find the example usage for java.lang Math 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) {

    // Returns 12.0 x (2^3)
    double scalbResult = Math.scalb(12.0, 3);
    System.out.println("Math.scalb (12.0, 3) = " + scalbResult);

}

From source file:Main.java

public static void main(String[] args) {

    double x = 12.34;
    int y = 4;/*from  w  w w.j a v a2 s .c o  m*/

    // calculate x multiplied by 2 raised in y
    System.out.println("Math.scalb(" + x + "," + y + ")=" + Math.scalb(x, y));

}

From source file:Main.java

public static void main(String[] args) {

    float x = 12.34f;
    int y = 4;/* w  ww . j av a  2 s  .  c  om*/

    // calculate x multiplied by 2 raised in y
    System.out.println("Math.scalb(" + x + "," + y + ")=" + Math.scalb(x, y));

}

From source file:com.idylwood.utils.MathUtils.java

static final double mantissa(final double d) {
    return abs(Math.scalb(d, -Math.getExponent(d)));
}

From source file:org.briljantframework.array.base.BaseArrayRoutines.java

@Override
public DoubleArray scalb(DoubleArray array, int scaleFactor) {
    return array.map(v -> Math.scalb(v, scaleFactor));
}