--- title: Math.acosh() slug: Web/JavaScript/Reference/Global_Objects/Math/acosh translation_of: Web/JavaScript/Reference/Global_Objects/Math/acosh original_slug: Web/JavaScript/Referencia/Objectes_globals/Math/acosh ---
La funció Math.acosh() retorna l'accosinus hiperbòlic d'un nombre, és a dir
Math.acosh(x)
xCom que que acosh() és un mètode estàtic de Math, sempre s'utilitza com a Math.acosh(), en comptes de com a mètode d'una instància de Math (Math no és un constructor).
Math.acosh()Math.acosh(-1); // NaN Math.acosh(0); // NaN Math.acosh(0.5) // NaN Math.acosh(1); // 0 Math.acosh(2); // 1.3169578969248166
Math.acosh() retorna {{jsxref("NaN")}} per a valors menors que 1.
Per a tot , tenim que i, per tant, es pot emular mitjançant la funció següent:
Math.acosh = Math.acosh || function(x) {
return Math.log(x + Math.sqrt(x * x - 1));
};
| Especificacions | Estat | Comentaris |
|---|---|---|
| {{SpecName('ES6', '#sec-math.acosh', 'Math.acosh')}} | {{Spec2('ES6')}} | Definició inicial. |
| Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Suport bàsic | {{CompatChrome("38")}} | {{CompatGeckoDesktop("25")}} | {{CompatNo}} | {{CompatOpera("25")}} | {{CompatSafari("7.1")}} |
| Característica | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Suport bàsic | {{CompatNo}} | {{CompatNo}} | {{CompatGeckoMobile("25")}} | {{CompatNo}} | {{CompatNo}} | 8 |