Java Math exp() Method
Example
Return e raised to the power of different 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 returns e raised to the power of a number (ex).
e is the base of the natural system of logarithms (approximately 2.718282). In Java, the value of e is available as the constant Math.E.
Syntax
public static double exp(double number)
Parameter Values
| Parameter | Description |
|---|---|
| number | Required. The power to which e is raised. |
Technical Details
| Returns: | A double value representing the result of e to the power of a number. |
|---|---|
| Java version: | Any |
❮ Math Methods