C-standard-library-c-function-tanh
提供:Dev Guides
Cライブラリ関数-tanh()
説明
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