Java Math.scalb(double d, int scaleFactor)
Syntax
Math.scalb(double d, int scaleFactor) has the following syntax.
public static double scalb(double d, int scaleFactor)
Example
In the following code shows how to use Math.scalb(double d, int scaleFactor) method.
/*w w w . ja v a 2 s . c om*/
public class Main {
public static void main(String[] args) {
double x = 12.34;
int y = 4;
// calculate x multiplied by 2 raised in y
System.out.println("Math.scalb(" + x + "," + y + ")=" + Math.scalb(x, y));
}
}
The code above generates the following result.