Math.asinh()

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2015 年 7 月⁩以來,各瀏覽器均已提供此特性。

Math.asinh() 靜態方法返回數字的逆雙曲正弦。即,

𝙼𝚊𝚝𝚑.𝚊𝚜𝚒𝚗𝚑(𝚡)=arsinh(x)=唯一y使得sinh(y)=x=ln(x+x2+1)\begin{aligned}\mathtt{\operatorname{Math.asinh}(x)} &= \operatorname{arsinh}(x) = \text{唯一滿足 } \sinh(y) = x \text{ 的 } y \\&= \ln\left(x + \sqrt{x^2 + 1}\right)\end{aligned}

試一試

console.log(Math.asinh(1));
// Expected output: 0.881373587019543

console.log(Math.asinh(0));
// Expected output: 0

console.log(Math.asinh(-1));
// Expected output: -0.881373587019543

console.log(Math.asinh(2));
// Expected output: 1.4436354751788103

語法

js
Math.asinh(x)

引數

x

一個數字。

返回值

x 的逆雙曲正弦。

描述

因為 asinh()Math 的靜態方法,所以您始終將其用作 Math.asinh(),而不是用作您建立的 Math 物件的(Math 不是建構函式)。

示例

使用 Math.asinh()

js
Math.asinh(-Infinity); // -Infinity
Math.asinh(-1); // -0.881373587019543
Math.asinh(-0); // -0
Math.asinh(0); // 0
Math.asinh(1); // 0.881373587019543
Math.asinh(Infinity); // Infinity

規範

規範
ECMAScript® 2026 語言規範
# sec-math.asinh

瀏覽器相容性

另見