java.lang.Math pow(double a,double b)

Description :

This java tutorial shows how to use the pow(double a, double b) method of Math class under java.lang package. This method just return the result of raising a to the power of b.

Method Syntax :

public static double pow(double a,double b)

Parameter Input :

DataType Parameter Description
double a the base
double b the exponent

Method Returns :

The abs(double a) method simply returns the value of the first argument raised to the power of the second argument.

Compatibility Version :

Requires Java 1.0 and up

Exception :

N/A

Java Code Example :

This java example source code demonstrates the use of pow(double a,double b) method of Math class. Basically we just get the result of raising the base to the exponent both comes from the user input.

Sample Output :

Running the power(double a,double b) method example source code of Math class will give you the following output

Exception Scenario :

N/A

Similar Method :

  • N/A

Suggested Reading List :

References :