C ++ atanh () - C ++ standaardbibliotheek

De functie atanh () in C ++ retourneert de arc hyperbolische tangens (inverse hyperbolische tangens) van een getal in radialen.

De functie atanh () accepteert één argument en retourneert de hyperbolische boogtangens van die waarde in radialen.

De functie is gedefinieerd in het header-bestand.

(Wiskunde) tanh -1 x = atanh (x) (In C ++ programmeren)

atanh () prototype (vanaf C ++ 11-standaard)

dubbele atanh (dubbele x); float atanh (float x); lange dubbele atanh (lange dubbele x); dubbele atanh (T x); // Voor integraal type

atanh () Parameters

De functie atanh () heeft één verplicht argument in het bereik (-1, 1).

Als de waarde groter is dan 1 of kleiner dan -1, treedt er een domeinfout op.

atanh () Retourwaarde

De functie atanh () geeft de inverse hyperbolische tangens terug van het argument dat eraan wordt doorgegeven.

atnah () Retourwaardetabel
Parameter (x) Winstwaarde
-1 <x <1 Eindige waarde
x = -1 -∞
x = 1
x 1 NaN (geen nummer

Voorbeeld 1: Hoe werkt de functie 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; ) 

Wanneer u het programma uitvoert, is de uitvoer:

 atanh (x) = 0,331647 radialen atanh (x) = 19,002 graden 

Voorbeeld 2: atanh () functie met integraal type

 #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; )

Wanneer u het programma uitvoert, is de uitvoer:

 atanh (x) = inf radiaal atanh (x) = inf graad 

Interessante artikelen...