tanh,tanhl

提供: RAD Studio
移動先: 案内検索

math.h:インデックス への移動


ヘッダーファイル

math.h

カテゴリ

演算ルーチン

プロトタイプ

double tanh(double x);

long double tanhl(long double x);

説明

ハイパーボリックタンジェントを計算します。

tanh は,ハイパーボリックタンジェント(sinh(x)/cosh(x))を計算します。

tanhl は long double バージョンです。long double 引数を受け取り,long double の結果を返します。これらの関数のエラー処理は,_matherr および _matherrl 関数を使って変更できます。

戻り値

tanh および tanhl は,x のハイパーボリックタンジェントを返します。



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



移植性



POSIX Win32 ANSI C ANSI C++

tanh

+

+

+

+

tanhl

+

+

+