Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Math.E: Euler’s number

Math.E is an immutable Number property approximating Euler’s number e, the base of the natural logarithm.

Version: ECMAScript 1 onward; example target: Node.js 24.22.2

Syntax

Math.E

Math.E is a Number value approximately equal to 2.718281828459045. It is a constant, not a function, so read it without parentheses. Its binary representation is a finite approximation of irrational e, and subsequent powers and arithmetic follow ordinary IEEE 754 rounding.

The Math.E descriptor has writable: false, enumerable: false, and configurable: false. Reflect.set(Math, "E", value) returns false, while assignment in strict code throws TypeError. The property cannot be deleted or redefined and does not appear in Object.keys(Math).

The constant has been standard since ECMAScript 1. It can be the base in Math.E ** x, but Math.exp(x) is usually clearer and numerically tailored for eˣ. Math.log uses the same base for natural logarithms. Do not round the constant before calculation; format only the displayed result.

Examples

console.log(Math.E.toFixed(15));
console.log((Math.E ** 2).toFixed(6), Math.exp(2).toFixed(6));
console.log(Math.log(Math.E));
const descriptor = Object.getOwnPropertyDescriptor(Math, "E");
console.log(descriptor.writable, descriptor.enumerable, descriptor.configurable);
console.log(Reflect.set(Math, "E", 3), Math.E.toFixed(6));

Result

2.718281828459045
7.389056 7.389056
1
false false false
false 2.718282

Sources