English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C++ Reference Manual

C++ Library Function <cmath>

C ++acosh() Function Usage and Example

The acosh() function in returns the inverse hyperbolic cosine (inverse hyperbolic cosine) of the radian number.

The acosh() function takes a single parameter and returns the inverse hyperbolic cosine value of the value in radians.<cmath>This function is in

defined in the header file.-1[Math] cosh++ x = acosh(x) [c

Language] ++ 11acosh() prototype [from C

Standard begins]
double acosh(double x);
float acosh(float x);
long double acosh(long double x); //double acosh(T x);

is an integer

acosh() parameter1acosh() function uses a single mandatory parameter, which is greater than or equal to

.1If the parameter is less than

acosh() return value

Then a domain error occurs.[0, ∞]acosh() function returns

range of values.1If the parameter passed to acosh() is less than

acosh() return value
ParameterReturn value
x> = 1[0, ∞]
x <1N

Example1: The acosh() function in C ++How does it work?

#include <iostream>
#include <cmath>
#define PI 3.141592654
using namespace std;
int main()
{
	double x = 13.21, result;
	result = acosh(x);
	cout << "acosh(x) = " << result << " radian " << endl;
	cout << "acosh(x) = " << result*180/PI << " degree " << endl;
	return 0;
}

When running the program, the output is:

acosh(x) = 3.27269 radian
acosh(x) = 187.511 degree

Example2: acosh() function with integer type

#include <iostream>
#include <cmath>
#define PI 3.141592654
using namespace std;
int main()
{
	int x = 4;
	double result;
	result = acosh(x);
	cout << "acosh(x) = " << result << " radian " << endl;
	cout << "acosh(x) = " << result*180/PI << " degree " << endl;
	return 0;
}

When running the program, the output is:

acosh(x) = 2.06344 radian
acosh(x) = 118.226 degree

  C++ Library Function <cmath>