English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C ++the atanh() function in the radians returns the inverse hyperbolic tangent (inverse hyperbolic tangent).
atanh() function takes a single parameter and returns the inverse hyperbolic tangent of the value in radians.
This function is in<cmath>header file is defined.
tanh-1 x = atanh(x)
double atanh(double x); float atanh(float x); long double atanh(long double x); double atanh(T x); // is of integer type
atanh() function takes a single mandatory parameter, ranging from [-1,1].
If the value is greater than1or less than-1occurs domain error.
atanh() function returns the inverse hyperbolic tangent of the parameter passed to it.
parameter (x) | return value |
---|---|
-1 <x <1 | finite value |
x = -1 | -∞ |
x = 1 | ∞ |
x <-1or x > 1 | NaN (not a number) |
#include <iostream> #include <cmath> #define PI 3.141592654 using namespace std; int main() { double x = 0.32, result; result = atanh(x); cout << "atanh(x) = " << result << " " << "radian" << endl; cout << "atanh(x) = " << result*180/PI << " " << endl; return 0; }
The output when running the program is:
atanh(x) = 0.331647 radian atanh(x) = 19.002 degree
#include <iostream> #include <cmath> #define PI 3.141592654 using namespace std; int main() { int x =; 1; double result; result = atanh(x); cout << "atanh(x) = " << result << " " << "radian" << endl; cout << "atanh(x) = " << result*180/PI << " " << endl; return 0; }
The output when running the program is:
atanh(x) = inf radian atanh(x) = inf degree