Math.asinh() 函数返回给定数字的反双曲正弦值, 即:
语法
Math.asinh(x)
参数
-
x - 待计算的数字。
返回值
给定数值的反双曲正弦值。
描述
由于asinh()是Math的静态方法, 用户应该直接通过Math.asinh()来使用, 而不是先创建出Math对象再调用该方法(Math不是一个构造器)。
示例
使用Math.asinh()
Math.asinh(1); // 0.881373587019543 Math.asinh(0); // 0
其他实现方式
由于 ,因此该函数可以被如下的函数所模拟:
Math.asinh = Math.asinh || function(x) {
if (x === -Infinity) {
return x;
} else {
return Math.log(x + Math.sqrt(x * x + 1));
}
};
规范
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) Math.asinh |
Standard | Initial definition. |
| ECMAScript Latest Draft (ECMA-262) Math.asinh |
Draft |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains.
Find out how you can help!
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 38 | 25 (25) | 未实现 | 25 | 7.1 |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | 未实现 | 未实现 | 25.0 (25) | 未实现 | 未实现 | 8 |