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

exp()

Example

Compute the exponential function for various input numbers.

System.out.println(Math.exp(0));
System.out.println(Math.exp(1));
System.out.println(Math.exp(10));
System.out.println(Math.exp(4.8));
System.out.println(Math.exp(Math.E));

Definition and Usage

The exp() method calculates the value of e raised to the power of a given number (ex).

Here, e represents the base of the natural logarithm system, approximately 2.718282. In Java, the constant Math.E holds the value of e.

Syntax

public static double exp(double number)

Parameter Values

Parameter

Description

number

Needed: The exponent for raising e.

Technical Details

Return

double value representing the outcome of raising e to a given exponent.

Java Version

Any