cosh function(Hyperbolic Cosine) in C Language – example and detail

In the C Programming Language, the cosh feature returns the hyperbolic cosine of x.


The syntax for the cosh function in the C Language is:

double cosh(double x);

Parameters or Arguments


A value expressed in radians (not degrees).


The cosh characteristic returns the hyperbolic cosine of x. If the magnitude of x is too large, the cosh characteristic will return a vary error.

Required Header

In the C Language, the required header for the cosh characteristic is:

#include <math.h>

Applies To

In the C Language, the cosh characteristic can be used in the following versions:

ANSI/ISO 9899-1990

cosh Example

/* Example using cosh by */

#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[])
    /* Define temporary variables */
    double value;
    double result;

    /* Assign the value we will find the cosh of */
    value = 0.5;

    /* Calculate the Hyperbolic Cosine of value */
    result = cosh(value);

    /* Display the result of the calculation */
    printf("The Hyperbolic Cosine of %f is %f\n", value, result);

    return 0;

When compiled and run, this software will output:

The Hyperbolic Cosine of 0.500000 is 1.127626

Similar Functions

Other C functions that are similar to the cosh function:

sinh function <math.h>

tanh function <math.h>

See Also

Other C features that are noteworthy when dealing with the cosh function:

acos function asin feature atan function atan2 feature cos feature sin function tan feature