tanh ()- 计算双曲正切

格式

#include <math.h>
double tanh(double x);

语言级别

ANSI

线程安全

描述

tanh() 函数计算 x的双曲正切,其中 x 以弧度表示。

返回值

tanh() 函数返回 x的双曲正切的值。 tanh() 的结果不能包含范围错误。

示例

此示例将 x 计算为 π/4 的双曲正切。
#include <math.h>
#include <stdio.h>
 
int main(void)
{
   double pi, x;
 
   pi = 3.1415926;
   x = tanh(pi/4);
 
   printf("tanh( %lf ) = %lf\n", pi/4, x);
}
 
/******************  Output should be similar to:  ****************
 
tanh( 0.785398 ) = 0.655794
*/

相关信息