Funkce cosh () vypočítá hyperbolický kosinus čísla.
cosh () Funkce Prototyp
double cosh (double x)
Funkce cosh () přebírá jediný argument (úhel v radiánech) a vrací hyperbolický kosinus tohoto úhlu jako typ double
.
Funkce cosh () je definována v hlavičkovém souboru "> math.h hlavičkovém souboru.
Chcete-li najít cosh () dlouhých dvojitých nebo floatových čísel, můžete použít následující prototyp.
dlouhý dvojitý háček (dlouhý dvojitý arg); float coshf (float arg);
Příklad: 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; )
Výstup
Hyperbolický kosinus 0,500000 (v radiánech) = 1,127626 Hyperbolický kosinus o -0,500000 (v radiánech) = 1,127626 Hyperbolický kosinus 0,000000 (v radiánech) = 1,000000 Hyperbolický kosinus 1,500000 (v radiánech) = 2,352410