Java Data Type Tutorial - Java StrictMath.scalb(float f, int scaleFactor)








Syntax

StrictMath.scalb(float f, int scaleFactor) has the following syntax.

public static float scalb(float f,  int scaleFactor)

Example

In the following code shows how to use StrictMath.scalb(float f, int scaleFactor) method.

// w ww .  j  a v  a 2 s  . c  om

public class Main {

  public static void main(String[] args) {
  
    float f1 = 5.0f , f2 = 1.23f, f3 = 0.0f;
    int power = 2;
        
    System.out.println(StrictMath.scalb(f1 , power));
        
    System.out.println(StrictMath.scalb(f2 , power));
        
    System.out.println(StrictMath.scalb(f3 , power));
  }
}

The code above generates the following result.