C cosh () - C Standardbibliothek

Die Funktion cosh () berechnet den hyperbolischen Kosinus einer Zahl.

cosh () Funktionsprototyp

 double cosh (double x)

Die Funktion cosh () verwendet ein einzelnes Argument (Winkel im Bogenmaß) und gibt den hyperbolischen Kosinus dieses Winkels als Typ zurück double.

Die Funktion cosh () ist in der Header-Datei "> math.h-Header-Datei definiert.

Um das cosh () von langen Doppel- oder Gleitkommazahlen zu finden, können Sie den folgenden Prototyp verwenden.

langes doppeltes coshl (langes doppeltes arg); float coshf (float arg);

Beispiel: C cosh ()

 #include #include int main () ( double x, result; x = 0.5; result = cosh(x); printf("Hyperbolic cosine of %lf (in radians) = %lf", x, result); x = -0.5; result = cosh(x); printf("Hyperbolic cosine of %lf (in radians) = %lf", x, result); x = 0; result = cosh(x); printf("Hyperbolic cosine of %lf (in radians) = %lf", x, result); x = 1.5; result = cosh(x); printf("Hyperbolic cosine of %lf (in radians) = %lf", x, result); return 0; )

Ausgabe

 Hyperbolischer Cosinus von 0,500000 (im Bogenmaß) = 1,127626 Hyperbolischer Cosinus von -0,500000 (im Bogenmaß) = 1,127626 Hyperbolischer Cosinus von 0,000000 (im Bogenmaß) = 1,000000 Hyperbolischer Cosinus von 1,500000 (im Bogenmaß) = 2,352410

Interessante Beiträge...