Funkcja JavaScript Math.atanh () zwraca arcus tangens hiperboliczny liczby.
atanh()
wykonuje operację odwrotną do Math.tanh
funkcji.
Składnia Math.atanh()
funkcji to:
Math.atanh(x)
atanh()
jako metoda statyczna jest wywoływana przy użyciu Math
nazwy klasy.
Parametry Math.atanh ()
Math.atanh()
Funkcja przyjmuje się:
- x - liczba
Wartość zwracana z Math.atanh ()
- Zwraca arcus tangens hiperboliczny dla podanej liczby.
- Zwraca,
NaN
jeśli liczba> 1 lub liczba <-1 .
Przykład: użycie Math.atanh ()
// Using Math.atanh() var num = Math.atanh(0); console.log(num); // 0 var num = Math.atanh(0.75); console.log(num); // 0.9729550745276566 var num = Math.atanh(1); console.log(num); // Infinity var num = Math.atanh(-1); console.log(num); // -Infinity var num = Math.atanh(2); console.log(num); // NaN var num = Math.atanh(-2); console.log(num); // NaN
Wynik
0 0,9729550745276566 Nieskończoność-Nieskończoność NaN NaN
Zalecane lektury:
- JavaScript Math tanh ()
- JavaScript Math asinh ()