C语言 <math.h> 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