--- title: Math.asinh() slug: Web/JavaScript/Reference/Global_Objects/Math/asinh translation_of: Web/JavaScript/Reference/Global_Objects/Math/asinh original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/asinh ---
La función Math.asinh() retorna el arcoseno hyperbólico de un número, es decir
Math.asinh(x)
xEl arcoseno hyperbólico del número dado.
Debido a que asinh() es un método estático de Math, siempre hay que usarlo como Math.asinh(), en lugar de como un método del objeto Math que se hayamos creado (Math no es un constructor).
Math.asinh()Math.asinh(1); // 0.881373587019543 Math.asinh(0); // 0
As a quick and dirty hack the expression may be used directly for a coarse emulation by the following function:
Math.asinh = Math.asinh || function(x) {
if (x === -Infinity) {
return x;
} else {
return Math.log(x + Math.sqrt(x * x + 1));
}
};
Been formally correct it suffers from a number of issues related to floating point computations. Accurate result requires special handling of positive/negative, small/large arguments as it done e.g. in glibc or GNU Scientific Library.
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('ES6', '#sec-math.asinh', 'Math.asinh')}} | {{Spec2('ES6')}} | Initial definition. |
| {{SpecName('ESDraft', '#sec-math.asinh', 'Math.asinh')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Math.asinh")}}