C-standard-library-c-function-cosh

提供:Dev Guides
移動先:案内検索

Cライブラリ関数-cosh()

説明

Cライブラリ関数* double cosh(double x)は、 *x の双曲線余弦を返します。

宣言

次に、cosh()関数の宣言を示します。

double cosh(double x)

パラメーター

  • x -これは浮動小数点値です。

戻り値

この関数は、xの双曲線余弦を返します。

次の例は、cosh()関数の使用法を示しています。

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

int main () {
   double x;

   x = 0.5;
   printf("The hyperbolic cosine of %lf is %lf\n", x, cosh(x));

   x = 1.0;
   printf("The hyperbolic cosine of %lf is %lf\n", x, cosh(x));

   x = 1.5;
   printf("The hyperbolic cosine of %lf is %lf\n", x, cosh(x));

   return(0);
}

上記のプログラムをコンパイルして実行し、次の結果を生成しましょう-

The hyperbolic cosine of 0.500000 is 1.127626
The hyperbolic cosine of 1.000000 is 1.543081
The hyperbolic cosine of 1.500000 is 2.352410