Math.E
La costante Math.E
rappresenta la base del logaritmo naturale, e, equivale approssimativamente a 2.718.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Property attributes of Math.E |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Descrizione
Poiché E
è una proprietà statica di Math
, lo si usa sempre come Math.E
, piuttosto che come un metodo di un Oggetto Math
appositamente creato (Math
non ha un costruttore).
Esempi
Uso di Math.E
Il codice seguente restitusice e:
function getNapier() {
return Math.E;
}
getNapier(); // 2.718281828459045
Specifiche
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'Math.E' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Math.E' in that specification. |
Standard | |
ECMAScript (ECMA-262) The definition of 'Math.E' in that specification. |
Living Standard |
Compatibilità Browser
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.