constants

Math.E

Euler's number, the base of the natural logarithm, approximately 2.718281828459045. A read-only numeric property.

Math.E

Parameters & edge cases

Case Behavior
precision Double-precision approximation of e — not exact
relation to exp Math.E === Math.exp(1) (up to floating-point equality)
relation to log Math.log(Math.E) === 1

Examples

console.log(Math.E);              // 2.718281828459045

The stored value.

console.log(Math.log(Math.E));    // 1

ln(e) = 1 by definition.

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

exp(1) matches Math.E exactly.

console.log(Math.pow(Math.E, 2)); // 7.3890560989306495

e² — note tiny rounding vs Math.exp(2) which returns 7.38905609893065.

Gotcha

Math.pow(Math.E, x) is slightly less accurate than Math.exp(x) because Math.E is rounded once before the power. Prefer Math.exp for e^x calculations.

Related

← All JS Math methods · Array methods