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

tanh

函数  <cmath> <ctgmath>

C90 double tanh(double x);
C99 double tanh (double x);
float tanhf (float x);
long double tanhl (long double x);
C++ double tanh (double x);
float tanh (float x);
long double tanh (long double x);
double tanh (T x);    // additional overloads for integral types

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

☲  参数


x
表示双曲角的值。

☉  返回值



返回x的双曲正切。

☣  示例



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

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

输出:
The hyperbolic tangent of 0.693147 is 0.600000.

🍄  另请参阅



cosh 双曲余弦(函数)
sinh 双曲正弦(函数)

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