目录

double tanh(double x)

描述 (Description)

C库函数double tanh(double x)返回double tanh(double x)的双曲正切值。

声明 (Declaration)

以下是tanh()函数的声明。

double tanh(double x)

参数 (Parameters)

  • x - 这是浮点值。

返回值 (Return Value)

此函数返回x的双曲正切值。

例子 (Example)

以下示例显示了tanh()函数的用法。

#include <stdio.h>
#include <math.h>
int main () {
   double x, ret;
   x = 0.5;
   ret = tanh(x);
   printf("The hyperbolic tangent of %lf is %lf degrees", x, ret);
   return(0);
}

让我们编译并运行上面的程序,它将产生以下结果 -

The hyperbolic tangent of 0.500000 is 0.462117 degrees
↑回到顶部↑
WIKI教程 @2018