C 庫函數 - cosh()

C 標準庫 - <math.h> C 標準庫 - <math.h>

描述

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("%lf 的雙曲余弦是 %lf\n", x, cosh(x));

   x = 1.0;
   printf("%lf 的雙曲余弦是 %lf\n", x, cosh(x));

   x = 1.5;
   printf("%lf 的雙曲余弦是 %lf\n", x, cosh(x));

   return(0);
}

讓我們編譯並運行上面的程式,這將產生以下結果:

0.500000 的雙曲余弦是 1.127626
1.000000 的雙曲余弦是 1.543081
1.500000 的雙曲余弦是 2.352410

C 標準庫 - <math.h> C 標準庫 - <math.h>