--- title: Math.E slug: Web/JavaScript/Reference/Global_Objects/Math/E tags: - JavaScript - Math - Property - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Math/E ---
{{JSRef}}

Math.E プロパティは自然対数の底 (e)、約 2.718 を表します。

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

{{EmbedInteractiveExample("pages/js/math-e.html")}}
{{js_property_attributes(0, 0, 0)}}

解説

EMath オブジェクトの静的プロパティなので、 Math オブジェクトを生成してプロパティとして使用するのではなく、常に Math.E として使用するようにしてください (Math はコンストラクターではありません)。

Math.E の使用

以下の関数は、e を返します。

function getNapier() {
  return Math.E;
}

getNapier(); // 2.718281828459045

仕様書

仕様書
{{SpecName('ESDraft', '#sec-math.e', 'Math.E')}}

ブラウザーの互換性

{{Compat("javascript.builtins.Math.E")}}

関連情報