Math.exp()

Returns e raised to the power of a number.

Since ES1 Spec ↗

Syntax

Math.exp(x)

Parameters

NameTypeRequiredDescription
x number Yes The exponent to raise e to.

Returns

number — e^x.

Examples

console.log(Math.exp(0));
Output
1
console.log(Math.exp(1) === Math.E);
Output
true

Notes

The inverse of `Math.log`. Large arguments overflow to Infinity. Use `Math.expm1` for accurate results when x is near zero.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12
node 0.10

See also