Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

cosh, coshf, coshl - Hyperbolic cosine

&pagelevel(4)&pagelevel

Definition

#include <math.h>

double cosh(double x);
float coshf(float x); (C11)
long double coshl(long double x); (C11)

These functions calculate the hyperbolic cosine for the floating-point number x.

Return val.

cosh(x)

for a floating-point number x.


HUGE_VAL
HUGE_VALF
HUGE_VALL

depending on the function type, if an overflow occurs.
errno is set to ERANGE (result too large).


Example

The following program lists the hyperbolic cosine values corresponding to input values in the interval [-1.0, +1.0].

#include <math.h>
#include <stdio.h>
int main(void)
{
  double x;
  for (x = -1.0; x < 1.0; x = x + 0.1)
    printf("cosh(%f) = %f\n", x, cosh(x));
  return 0;
}

See also

acos, cos, sin, asin, sinh, tan, atan, atan2, tanh