cosh() - Mathematical Function

How is Mathematical Function "cosh()" used in C++?
How to find the hyperbolic cosine value of an argument using c++?


cosh() is a Mathematical Function that returns the hyperbolic cosine for the given argument. If the value returned by this function is large, then the "HUGE_VAL" is returned, by setting the "errno" to the "ERNAGE" value.

Syntax to find Hyperbolic Cosine Value:

float cosh( float arg );
double cosh( double arg );
long double cosh( long double arg );

Example :

#include <iostream.h>
#include <cmath.h>
int main ()
cout << "Hyperbolic cosine of 3 is :: " << cosh(3) ;
return 0;

Result :

Hyperbolic cosine of 3 is :: 10.0677

In the above example cosh() is used to find the hyperbolic cosine for "3".

C++ Tutorial

Ask Questions

Ask Question