English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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
Standard begins] double acosh(double x); float acosh(float x); long double acosh(long double x); //double acosh(T x);
acosh() parameter1acosh() function uses a single mandatory parameter, which is greater than or equal to
.1If the parameter is less than
Then a domain error occurs.[0, ∞]acosh() function returns
range of values.1If the parameter passed to acosh() is less than
Parameter | Return value |
---|---|
x> = 1 | [0, ∞] |
x <1 | N |
#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
#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