C 庫(kù)函數(shù) - tanh()

C 標(biāo)準(zhǔn)庫(kù) - <math.h> C 標(biāo)準(zhǔn)庫(kù) - <math.h>

描述

C 庫(kù)函數(shù) double tanh(double x) 返回 x 的雙曲正切。

聲明

下面是 tanh() 函數(shù)的聲明。

double tanh(double x)

參數(shù)

  • x -- 浮點(diǎn)值。

返回值

該函數(shù)返回 x 的雙曲正切。

實(shí)例

下面的實(shí)例演示了 tanh() 函數(shù)的用法。

#include <stdio.h>
#include <math.h>

int main ()
{
   double x, ret;
   x = 0.5;

   ret = tanh(x);
   printf("%lf 的雙曲正切是 %lf 度", x, ret);
   
   return(0);
}

讓我們編譯并運(yùn)行上面的程序,這將產(chǎn)生以下結(jié)果:

0.500000 的雙曲正切是 0.462117 度

C 標(biāo)準(zhǔn)庫(kù) - <math.h> C 標(biāo)準(zhǔn)庫(kù) - <math.h>