Math : méthode statique atanh()
Baseline
Widely available
Cette fonctionnalité est bien établie et fonctionne sur de nombreux appareils et versions de navigateurs. Elle est disponible sur tous les navigateurs depuis juillet 2015.
La méthode statique Math.atanh() retourne l'arc tangente hyperbolique d'un nombre. C'est-à-dire,
Exemple interactif
console.log(Math.atanh(-1));
// Sortie attendue : -Infinity
console.log(Math.atanh(0));
// Sortie attendue : 0
console.log(Math.atanh(0.5));
// Sortie attendue : 0.549306144334055 (approximativement)
console.log(Math.atanh(1));
// Sortie attendue : Infinity
Syntaxe
js
Math.atanh(x)
Paramètres
x-
Un nombre compris entre -1 et 1, inclus.
Valeur de retour
La tangente hyperbolique inverse de x. Si x est 1, retourne Infinity. Si x est -1, retourne -Infinity. Si x est inférieur à -1 ou supérieur à 1, retourne NaN.
Description
Parce que atanh() est une méthode statique de Math, vous l'utilisez toujours comme Math.atanh(), et non comme méthode d'un objet Math que vous auriez créé (Math n'est pas un constructeur).
Exemple
>Utiliser la méthode Math.atanh()
js
Math.atanh(-2); // NaN
Math.atanh(-1); // -Infinity
Math.atanh(-0); // -0
Math.atanh(0); // 0
Math.atanh(0.5); // 0.5493061443340548
Math.atanh(1); // Infinity
Math.atanh(2); // NaN
Spécifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.atanh> |
Compatibilité des navigateurs
Voir aussi
- Prothèse d'émulation de
Math.atanhdanscore-js(angl.) - Prothèse d'émulation es-shims de
Math.atanh(angl.) - La méthode statique
Math.acosh() - La méthode statique
Math.asinh() - La méthode statique
Math.cosh() - La méthode statique
Math.sinh() - La méthode statique
Math.tanh()