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

浏览器兼容性

另见