Math.E

概述

Math.E 属性表示自然对数的底数(或称为基数),e,约等于 2.718。

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

Math.E 的属性特性
可写
可枚举
可配置

描述

由于 EMath 对象的静态属性,所以应该像这样使用:Math.E,而不是作为你创建的 Math 实例对象的属性(Math 不是构造函数)。

示例

示例:使用 Math.E

下面的函数返回 e:

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

getNapier(); // 2.718281828459045

规范

Specification
ECMAScript Language Specification
# sec-math.e

浏览器兼容性

BCD tables only load in the browser

参见