English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The cosh() function calculates the hyperbolic cosine value of a number.
double cosh(double x)
The cosh() function takes a single parameter (angle in radians) and returns the hyperbolic cosine value of the angle as a double type.
The cosh() function inmath.hDefined in the header file.
To find cosh() for long double or float, you can also use the following prototypes.
long double coshl(long double arg); float coshf(float arg);
#include <stdio.h> #include <math.h> int main() { double x, result; x = 0.8; result = cosh(x); printf("%lf hyperbolic cosine (in radians) = %lf\n", x, result); x = -0.8; result = cosh(x); printf("%lf hyperbolic cosine (in radians) = %lf\n", x, result); x = 0; result = cosh(x); printf("%lf hyperbolic cosine (in radians) = %lf\n", x, result); x = 1.5; result = cosh(x); printf("%lf hyperbolic cosine (in radians) = %lf\n", x, result); return 0; }
Output Result
0.8Hyperbolic cosine (in radians) of 00000 = 1.337435 -0.8Hyperbolic cosine (in radians) of 00000 = 1.337435 Hyperbolic cosine (in radians) of 0.000000 = 1.000000 1.5Hyperbolic cosine (in radians) of 00000 = 2.352410