cosh()

Returns the hyperbolic cosine of an argument given in radians.

Syntax

std::cosh(n)

Example 1

Use cosh() to return the hyperbolic cosine of 0.0 radians:

#include <iostream>
#include <cmath>
int main() {
double x = 0.0;
double result;
result = std::cosh(x);
std::cout << "The hyperbolic cosine of " << x << " radians is " << result << "\n";
// Output: The hyperbolic cosine of 0 radians is 1
}

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn C++ on Codecademy