JavaScript (ES2026) reference · Math Methods and Constants
JavaScript Math.exp() Method
Return e (about 2.718) raised to the given power, used for exponential growth, decay and probability formulas.
JavaScript (ES2026) Since ES1
Syntax
Math.exp(x)
Parameters
| Parameter | Description |
|---|---|
x |
A number. |
Return value
A number.
Examples
console.log(Math.exp(0), Math.exp(1) === Math.E);
Output
1 true
const decay = (n0, k, t) => n0 * Math.exp(-k * t);
console.log(decay(100, 0.1, 10).toFixed(2));
Output
36.79
Version history
| Version | Change |
|---|---|
| JavaScript ES1 | Added |
Related
Math.log()· Return the natural logarithm (base e) of a number; divide by Math.log(base) to get a logarithm in any base.Math.pow()· Return a base raised to an exponent. The ** operator does the same: Math.pow(2, 10) equals 2 ** 10.- JavaScript Math · tutorial
- JavaScript Numbers · tutorial