C <math.h> - cosh() Function
The C <math.h> cosh() function returns hyperbolic cosine of a value. The hyperbolic cosine of x is defined as:
where e is an Euler's number.
Syntax
double cosh (double x); float coshf (float x); long double coshl (long double x);
Parameters
x |
Specify the value. |
Return Value
Returns the hyperbolic cosine of a value.
Example:
In the example below, cosh() function is used to find out the hyperbolic cosine of a value.
#include <stdio.h> #include <math.h> int main (){ printf("%lf\n", cosh(0)); printf("%lf\n", cosh(2)); printf("%lf\n", cosh(4)); return 0; }
The output of the above code will be:
1.000000 3.762196 27.308233
❮ C <math.h> Library