Questa traduzione è incompleta. Collabora alla traduzione di questo articolo dall’originale in lingua inglese.
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 Latest Draft (ECMA-262) The definition of 'Math.E' in that specification. |
Draft |
Compatibilità 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.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | Yes | Yes | 1 | Yes | Yes | Yes |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|---|---|
Basic support | Yes | Yes | Yes | 4 | Yes | Yes | Yes |