Funktionen cosh () beräknar det hyperboliska cosinus för ett tal.
cosh () Funktion Prototyp
dubbel cosh (dubbel x)
Funktionen cosh () tar ett enda argument (vinkel i radianer) och returnerar den hyperboliska cosinus för den vinkeln som typ double
.
Funktionen cosh () definieras i rubrikfilen "> math.h-rubrikfilen.
För att hitta cosh () av långa dubbla eller flytande siffror kan du använda följande prototyp.
lång dubbel coshl (lång dubbel arg); float coshf (float arg);
Exempel: 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; )
Produktion
Hyperbolisk cosinus på 0.500.000 (i radianer) = 1.127626 Hyperbolic cosinus på -0.500.000 (i radianer) = 1.127626 Hyperbolisk cosinus på 0.000000 (i radianer) = 1.000000 Hyperbolisk cosinus på 1.500.000 (i radianer) = 2.352410