bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math pow() Method

❮ Math Methods

Example

System.out.println(Math.pow(2, 8));
System.out.println(Math.pow(3, 4));
System.out.println(Math.pow(9, 0.5));
System.out.println(Math.pow(8, -1));
System.out.println(Math.pow(10, -2));

Definition and Usage

The pow() method raises a number to the power of another number.

Syntax

public static double pow(double
base , double
exponent )

Parameter Values

ParameterDescription
baseRequired. The base of the operation.
exponentRequired. The exponent of the operation.

Technical Details

Returns:A double value representing the result of the base to the power of the exponent.
Java version:Any

Previous

Java Math nextUp() Method

Next

Java Math random() Method