目录

double cosh(double x)

描述 (Description)

C库函数double cosh(double x)返回double cosh(double x)的hypebolic余弦值。

声明 (Declaration)

以下是cosh()函数的声明。

double cosh(double x)

参数 (Parameters)

  • x - 这是浮点值。

返回值 (Return Value)

此函数返回x的双曲余弦值。

例子 (Example)

以下示例显示了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
↑回到顶部↑
WIKI教程 @2018