Curriculum
Course: Java Basic
Login

Curriculum

Java Basic

Java Home

0/1

Java Introduction

0/1

Java Get Started

0/1

Java Syntax

0/1

Java Comments

0/1

Java Type Casting

0/1

Java Operators

0/1

Java Booleans

0/1

Java Switch

0/1

Java Break / Continue

0/1

Java Errors and Exception

0/1
Text lesson

pow()

Example

Compute the exponentiation of various numbers to different powers.

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 computes the exponentiation of one number to the power of another.

Syntax

public static double pow(double base, double exponent)

Parameter Values

Parameter

Description

base

Please specify the base of the operation.

exponent

Please specify the exponent of the operation.

Technical Details

Returns:

A double value representing the result of raising the base to the power of the exponent.

Java Version:

Any