From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../reference/global_objects/math/expm1/index.html | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/math/expm1/index.html (limited to 'files/ja/web/javascript/reference/global_objects/math/expm1') diff --git a/files/ja/web/javascript/reference/global_objects/math/expm1/index.html b/files/ja/web/javascript/reference/global_objects/math/expm1/index.html new file mode 100644 index 0000000000..dd66595f56 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/math/expm1/index.html @@ -0,0 +1,87 @@ +--- +title: Math.expm1() +slug: Web/JavaScript/Reference/Global_Objects/Math/expm1 +tags: + - JavaScript + - Math + - Method + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Math/expm1 +--- +
{{JSRef}}
+ +

Math.expm1() 関数は ex - 1 (x は引数、 {{jsxref("Math.E", "e", "", 1)}} は自然対数の底) を返します。

+ +
{{EmbedInteractiveExample("pages/js/math-expm1.html")}}
+ + + +

構文

+ +
Math.expm1(x)
+ +

引数

+ +
+
x
+
数値です。
+
+ +

返値

+ +

ex - 1 (e は{{jsxref("Math.E", "オイラー数", "", 1)}}、 x は引数) を表す数値です。

+ +

解説

+ +

expm1()Math の静的メソッドであるため、生成した Math オブジェクトのメソッドとしてではなく、常に Math.expm1() として使用するようにしてください (Math はコンストラクターではありません)。

+ +

+ +

Math.expm1() の使用

+ +
Math.expm1(-1); // -0.6321205588285577
+Math.expm1(0);  // 0
+Math.expm1(1);  // 1.718281828459045
+
+ +

ポリフィル

+ +

これは {{jsxref("Math.exp()")}} 関数の助けを借りてエミュレートすることができます。

+ +
Math.expm1 = Math.expm1 || function(x) {
+  return Math.exp(x) - 1;
+};
+
+ +

仕様書

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

ブラウザーの互換性

+ + + +

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

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf