Die atanh () - Funktion in C ++ gibt die hyperbolische Tangente (inverse hyperbolische Tangente) einer Zahl im Bogenmaß zurück.
Die Funktion atanh () verwendet ein einzelnes Argument und gibt den bogenhyperbolischen Tangens dieses Werts im Bogenmaß zurück.
Die Funktion ist in der Header-Datei definiert.
(Mathematik) tanh -1 x = atanh (x) (In C ++ Programmierung)
atanh () Prototyp (Stand C ++ 11 Standard)
doppeltes atanh (doppeltes x); float atanh (float x); langes doppeltes atanh (langes doppeltes x); doppeltes Atanh (T x); // Für integralen Typ
atanh () Parameter
Die Funktion atanh () verwendet ein einzelnes obligatorisches Argument im Bereich (-1, 1).
Wenn der Wert größer als 1 oder kleiner als -1 ist, tritt ein Domänenfehler auf.
atanh () Rückgabewert
Die Funktion atanh () gibt die inverse hyperbolische Tangente des an sie übergebenen Arguments zurück.
atnah () RückgabewerttabelleParameter (x) | Rückgabewert |
---|---|
-1 <x <1 | Endlicher Wert |
x = -1 | -∞ |
x = 1 | ∞ |
x 1 | NaN (keine Zahl |
Beispiel 1: Wie funktioniert die Funktion atanh () in C ++?
#include #include #define PI 3.141592654 using namespace std; int main() ( double x = 0.32, result; result = atanh(x); cout << "atanh(x) = " << result << " radian" << endl; // result in degrees cout << "atanh(x) = " << result*180/PI << " degree" << endl; return 0; )
Wenn Sie das Programm ausführen, lautet die Ausgabe wie folgt:
atanh (x) = 0,331647 radian atanh (x) = 19,002 Grad
Beispiel 2: atanh () -Funktion mit ganzzahligem Typ
#include #include #define PI 3.141592654 using namespace std; int main() ( int x = 1; double result; result = atanh(x); cout << "atanh(x) = " << result << " radian" << endl; // result in degrees cout << "atanh(x) = " << result*180/PI << " degree" << endl; return 0; )
Wenn Sie das Programm ausführen, lautet die Ausgabe wie folgt:
atanh (x) = inf radian atanh (x) = inf grad