このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。
Math.atanh()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
Math.atanh() は静的メソッドで、数値の双曲線逆正接 (ハイパーボリックアークタンジェント) を返します。
In this article
試してみましょう
console.log(Math.atanh(-1));// 予想される結果: -Infinityconsole.log(Math.atanh(0));// 予想される結果: 0console.log(Math.atanh(0.5));// 予想される結果: 0.549306144334055 (およそ)console.log(Math.atanh(1));// 予想される結果: Infinity構文
js
Math.atanh(x)引数
x-1 ~ 1 の間で両端を含む数値です。
返値
x の双曲線逆正接 (ハイパーボリックアークタンジェント) です。x が 1 の場合、Infinity を返します。x が -1 の場合、-Infinity を返します。x が -1 未満であるか 1 より大きな場合は、NaN を返します。
解説
atanh() はMath の静的メソッドであるため、生成したMath オブジェクトのメソッドとしてではなく、常にMath.atanh() として使用するようにしてください (Math はコンストラクターではありません)。
例
>Math.atanh() の使用
js
Math.atanh(-2); // NaNMath.atanh(-1); // -InfinityMath.atanh(-0); // -0Math.atanh(0); // 0Math.atanh(0.5); // 0.5493061443340548Math.atanh(1); // InfinityMath.atanh(2); // NaN仕様書
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.atanh> |