De functie atanh () geeft de hyperbolische boogtangens (inverse hyperbolische tangens) van een getal in radialen terug.
De atanh()
functie accepteert één argument (-1 ≦ x ≧ 1) en geeft de hyperbolische tangens van de boog in radialen terug.
De atanh()
functie is opgenomen in het header-bestand.
atanh () Prototype
dubbele atanh (dubbele x);
Om erachter te arc hyperbolische tangens van het type int
, float
of long double
, kunt u expliciet converteren het type om double
met behulp van cast operator.
int x = 0; dubbel resultaat; resultaat = atanh (dubbel (x));
Ook zijn twee functies atanhf () en atanhl () geïntroduceerd in C99 om specifiek te werken met respectievelijk type float
en long double
.
zweven atanhf (zweven x); lange dubbele atanhl (lange dubbele x);
atanh () Parameter
De atanh()
functie accepteert één argument groter dan of gelijk aan -1 en kleiner dan of gelijk aan 1.
Parameter | Omschrijving |
---|---|
dubbele waarde | Verplicht. Een dubbele waarde groter dan of gelijk aan 1 (-1 ≦ x ≧ 1). |
Voorbeeld 1: atanh () functie met verschillende parameters
#include #include int main() ( // constant PI is defined const double PI = 3.1415926; double x, result; x = -0.5; result = atanh(x); printf("atanh(%.2f) = %.2lf in radians", x, result); // converting radians to degree result = atanh(x)*180/PI; printf("atanh(%.2f) = %.2lf in degrees", x, result); // parameter not in range x = 3; result = atanh(x); printf("atanh(%.2f) = %.2lf", x, result); return 0; )
Uitvoer
atanh (-0,50) = -0,55 in radialen atanh (-0,50) = -31,47 in graden atanh (3,00) = nan