--- title: Math.E slug: Web/JavaScript/Reference/Global_Objects/Math/E translation_of: Web/JavaScript/Reference/Global_Objects/Math/E ---
La costante Math.E
rappresenta la base del logaritmo naturale, e, equivale approssimativamente a 2.718.
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).
Uso di Math.E
Il codice seguente restitusice e:
function getNapier() { return Math.E; } getNapier(); // 2.718281828459045
Specification | Status | Comment |
---|---|---|
{{SpecName('ES1')}} | {{Spec2('ES1')}} | Initial definition. Implemented in JavaScript 1.0. |
{{SpecName('ES5.1', '#sec-15.8.1.1', 'Math.E')}} | {{Spec2('ES5.1')}} | |
{{SpecName('ES6', '#sec-math.e', 'Math.E')}} | {{Spec2('ES6')}} | |
{{SpecName('ESDraft', '#sec-math.e', 'Math.E')}} | {{Spec2('ESDraft')}} |
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.
{{Compat("javascript.builtins.Math.E")}}