Facebook Page Twitter Page LinkedIn Page
× C Tutorial C Resources


The C math cosh() function is used to return hyperbolic cosine of a value. The hyperbolic cosine of x is defined as:

cosh

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 below example, 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