Java Data Type Tutorial - Java StrictMath.pow(double a, double b)








Syntax

StrictMath.pow(double a, double b) has the following syntax.

public static double pow(double a,  double b)

Example

In the following code shows how to use StrictMath.pow(double a, double b) method.

//from  ww w  .  ja  v a  2  s.c  om
public class Main {

  public static void main(String[] args) {
    double d1 = 1.2 , d2 = 3.4, d3 = 1;

    System.out.println(""+ d1 + " to the power of " + d2 + " = " + StrictMath.pow(d1 , d2));
     
    System.out.println(""+ d1 + " to the power of " + d3 + " = " + StrictMath.pow(d1 , d3));
  }
}

The code above generates the following result.