--- title: Math.sinh() slug: Web/JavaScript/Reference/Global_Objects/Math/sinh translation_of: Web/JavaScript/Reference/Global_Objects/Math/sinh original_slug: Web/JavaScript/Referencia/Objectes_globals/Math/sinh ---
La funció Math.sinh() retorna el sinus hiperbòlic d'un nombre, que es pot expressar utilitzant la {{jsxref("Math.E", "constant e", "", 1)}}:
Math.sinh(x)
xCom que que sinh() és un mètode estàtic de Math, sempre s'utilitza com a Math.sinh(), en comptes de com a mètode d'una instància de Math (Math no és un constructor).
Math.sinh()Math.sinh(0); // 0 Math.sinh(1); // 1.1752011936438014
Aquest comportament es pot emular amb l'ajut de la funció {{jsxref("Math.exp()")}}:
Math.sinh = Math.sinh || function(x) {
return (Math.exp(x) - Math.exp(-x)) / 2;
}
O bé utilitzant només una crida a la funció {{jsxref("Math.exp()")}}:
Math.sinh = Math.sinh || function(x) {
var y = Math.exp(x);
return (y - 1 / y) / 2;
}
| Especificació | Estat | Comentaris |
|---|---|---|
| {{SpecName('ES6', '#sec-math.sinh', 'Math.sinh')}} | {{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 |