| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Math/E | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since 20157.
Math.E Euler's number e 2.718
function compoundOneYear(interestRate, currentVal) {
return currentVal * Math.E ** interestRate;
}
console.log(Math.E);
// 2.718281828459045
console.log((1 + 1 / 1000000) ** 1000000);
// 2.718280469 (approximately)
console.log(compoundOneYear(0.05, 100));
// 105.12710963760242
Math.E | |
|---|---|
E Math Math.E Math Math
e
function getNapier() {
return Math.E;
}
getNapier(); // 2.718281828459045
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-math.e |
This page was last modified on 202622 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |