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
*/