Standards / Extensions | C or C++ | Dependencies |
---|---|---|
ISO C |
both |
#include <math.h>
double cosh(double x);
float cosh(float x); /* C++ only */
long double cosh(long double x); /* C++ only */
float coshf(float x);
long double coshl(long double x);
If the result overflows, the function returns +HUGE_VAL and sets errno to ERANGE.
⁄* CELEBC27
This example calculates y to be the hyperbolic cosine of x.
*⁄
#include <math.h>
#include <stdio.h>
int main(void)
{
double x,y;
x = 7.2;
y = cosh(x);
printf("cosh( %lf ) = %lf\n", x, y);
}
cosh( 7.200000 ) = 669.715755