Math.sinh()
Math.sinh() 靜態方法返回一個數字的雙曲正弦。即:
試一試
console.log(Math.sinh(0));
// Expected output: 0
console.log(Math.sinh(1));
// Expected output: 1.1752011936438014
console.log(Math.sinh(-1));
// Expected output: -1.1752011936438014
console.log(Math.sinh(2));
// Expected output: 3.626860407847019
語法
js
Math.sinh(x)
引數
x-
一個數字。
返回值
x 的雙曲正弦。
描述
因為 sinh() 是 Math 的靜態方法,所以您總是使用 Math.sinh() 的方式來呼叫它,而不是透過您建立的 Math 物件的方法來呼叫(Math 不是建構函式)。
示例
使用 Math.sinh()
js
Math.sinh(-Infinity); // -Infinity
Math.sinh(-0); // -0
Math.sinh(0); // 0
Math.sinh(1); // 1.1752011936438014
Math.sinh(Infinity); // Infinity
規範
| 規範 |
|---|
| ECMAScript® 2026 語言規範 # sec-math.sinh |
瀏覽器相容性
載入中…