C atanh () - C Standardbibliothek

Die Funktion atanh () gibt die bogenhyperbolische Tangente (inverse hyperbolische Tangente) einer Zahl im Bogenmaß zurück.

Die atanh()Funktion verwendet ein einzelnes Argument (-1 ≦ x ≧ 1) und gibt die bogenhyperbolische Tangente im Bogenmaß zurück.

Die atanh()Funktion ist in der Header-Datei enthalten.

atanh () Prototyp

 doppeltes atanh (doppeltes x);

Um Tangenshyperbolicus vom Typ zu finden Bogen int, floatoder long doublekönnen Sie explizit den Typ konvertieren doublemit Cast - Operator.

int x = 0; doppeltes Ergebnis; Ergebnis = atanh (doppelt (x));

Auch zwei Funktionen atanhf () und atanhl () wurden in C99 eingeführt spezifisch mit Typ zu arbeiten floatund long doublejeweils.

float atanhf (float x); langes doppeltes atanhl (langes doppeltes x);

atanh () Parameter

Die atanh()Funktion akzeptiert ein einzelnes Argument, das größer oder gleich -1 und kleiner oder gleich 1 ist.

Parameter Beschreibung
doppelter Wert Erforderlich. Ein Doppelwert größer oder gleich 1 (-1 ≦ x ≧ 1).

Beispiel 1: atanh () -Funktion mit verschiedenen Parametern

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

Ausgabe

 atanh (-0,50) = -0,55 im Bogenmaß atanh (-0,50) = -31,47 in Grad atanh (3,00) = nan 

Interessante Beiträge...