Home C&C++函数库 c++ 语法 程序源码 Linux C库

atanh

函数  <cmath> <ctgmath>

C99 double atanh (double x);
float atanhf (float x);
long double atanhl (long double x);
C++11 double atanh (double x);
float atanh (float x);
long double atanh (long double x);
double atanh (T x);    // additional overloads for integral types

计算反双曲正切
返回x的反双曲正切。
反双曲正切是双曲正切的逆运算.
C99 头文件<tgmath.h> 提供了该函数的类型泛型宏版本。
C++11 这个头文件(<cmath>) 为整型提供了额外的重载:这些重载在计算之前将x转换为double (在T是任何整型时定义)。
这个函数在<complex> 中也重载(参见complex atanh)。

☲  参数


x
在区间[-1,+1]内计算其反双曲正切的值。如果参数超出了这个间隔,就会发生域错误。
对于-1和+1的值,可能发生极点误差。

☉  返回值



返回x的 双曲正切。
如果出现域错误:

-并且math_errhandling设置了MATH_ERRNO: 全局变量errno设置为 EDOM.。
-并且math_errhandling设置了MATH_ERREXCEPT: 触发 FE_INVALID
如果出现极点错误:

-并且math_errhandling设置了MATH_ERRNO: 全局变量errno设置为 ERANGE。
-并且math_errhandling设置了MATH_ERREXCEPT: 触发FFE_DIVBYZERO

☣  示例



/* atanh example */
#include <stdio.h>      /* printf */
#include <math.h>       /* tanh, atanh */

int main ()
{
  double param, result;
  param = tanh(1);
  result = atanh(param) ;
  printf ("The area hyperbolic tangent of %f is %f.\n", param, result);
  return 0;
}

输出:
The area hyperbolic tangent of 0.761594 is 1.000000.

🍄  另请参阅



tanh 双曲正切(function )
acosh 反双曲余弦(函数)
asinh 反双曲正弦(函数)

联系我们 免责声明 关于CandCplus 网站地图