bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math scalb() Method

❮ Math Methods

Example

System.out.println(Math.scalb(1.5, 4));
System.out.println(Math.scalb(1.0, 5));
System.out.println(Math.scalb(1.2, 0));
System.out.println(Math.scalb(1.85, 10));

Definition and Usage

The scalb() method returns the result of the formula x ·2 y for a floating point number x and an integer y .

One of the following

public static double scalb(double
x , int
y )
public static float scalb(float
x , int
y )

Parameter Values

ParameterDescription
xRequired. The number to be multiplied by the power of 2.
yRequired. The exponent for the base 2.

Technical Details

Returns:A double or float value representing the result of the formula x ·2 y .
Java version:1.6+

Previous

Java Math round() Method

Next

Java Math signum() Method