Math.sinh()
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.sinh() 静的メソッドは、数値の双曲線正弦 (ハイパーボリックサイン) を返します。
試してみましょう
console.log(Math.sinh(0));
// 予想される結果: 0
console.log(Math.sinh(1));
// 予想される結果: 1.1752011936438014
console.log(Math.sinh(-1));
// 予想される結果: -1.1752011936438014
console.log(Math.sinh(2));
// 予想される結果: 3.626860407847019
構文
js
Math.sinh(x)
引数
x-
数値です。
返値
x の双曲線正弦 (ハイパーボリックサイン) です。
解説
sinh() は Math の静的メソッドであるため、生成した Math オブジェクトのメソッドとしてではなく、常に Math.sinh() として使用するようにしてください (Math はコンストラクターではありません)。
例
>Using Math.sinh() の使用
js
Math.sinh(-Infinity); // -Infinity
Math.sinh(-0); // -0
Math.sinh(0); // 0
Math.sinh(1); // 1.1752011936438014
Math.sinh(Infinity); // Infinity
仕様書
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.sinh> |
ブラウザーの互換性
Loading…