Facebook Page Twitter Page LinkedIn Page
× C++ Standard Library C++ STL Library


The C++ <cmath> acosh() function returns inverse hyperbolic cosine of a value. The hyperbolic cosine of x is defined as:

acosh

Syntax

double acosh (double x);
float acosh (float x);
long double acosh (long double x);
double acosh (T x);           

Parameters

x Specify the value equal to or greater than 1.

Return Value

Returns the hyperbolic cosine of a value.
If the x is less than 1, domain error occurs.

Example:

In the example below, acosh() function is used to find out the hyperbolic cosine of a value.

#include <iostream>
#include <cmath>
using namespace std;
 
int main (){
  cout<<acosh(0)<<"\n";
  cout<<acosh(2)<<"\n";
  cout<<acosh(4)<<"\n";
  return 0;
}

The output of the above code will be:

-nan
1.31696
2.06344

❮ C++ <cmath> Library

5