Math.E

La propriété Math.E représente la base du logarithme naturel, e, et vaut environ 2.718.

Math.E = e 2.718 \mathtt{\mi{Math.E}} = e \approx 2.718

Exemple interactif

Attributs de Math.E
Écrivable Non
Énumérable Non
Configurable Non

Description

E étant une propriété statique de Math, il doit toujours être utilisé avec la syntaxe Math.E, et non pas être appelé comme propriété d'un autre objet Math qui aurait été créé (Math n'est pas un constructeur).

Exemples

Utiliser Math.E

La fonction suivante renvoie la valeur de e :

js
function getNapier() {
  return Math.E;
}

getNapier(); // 2.718281828459045

Spécifications

Specification
ECMAScript Language Specification
# sec-math.e

Compatibilité des navigateurs

BCD tables only load in the browser

Voir aussi