tanh() – C函数

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

声明

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

double tanh(double x)

参数

  • x -- 这是浮点值。

返回值

这个函数返回x的双曲正切。

例子

下面的例子演示了如何使用 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

以上是tanh() – C函数的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>