.scalb()
The Math.scalb()
method returns the first argument multiplied by 2 to the power of the second argument.
Syntax
Math.scalb(value, scale)
The parameter value
is of type double
and the parameter scale
is of type int
.
Example
// Main.javapublic class Main {public static void main(String[] args) {double value = 23.2;int scale = 4;int scale2 = 7;System.out.println(Math.scalb(value, scale));System.out.println(Math.scalb(value, scale2));}}
This will produce the following output:
371.22969.6
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.