Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind Java Math scalb() Method?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___.out.println(Math.scalb(1.5, 4));3Order
Put the learning moves in the order that makes the concept easiest to apply.
The scalb() method returns the result of the formula x ·2 y for a floating point number x and an integer y .
Definition and Usage
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
| Parameter | Description |
|---|---|
| x | Required. The number to be multiplied by the power of 2. |
| y | Required. 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+ |