Dotcpp  >  编程教程  >  <math.h>头文件  >  C语言cosh()函数:计算双曲余弦值

C语言cosh()函数:计算双曲余弦值

点击打开在线编译器,边学边练

函数名: cosh

头文件:<math.h>

函数原型: double cosh(double x);

功 能: 计算双曲余弦值

参 数: double x   为要计算双曲正弦值 

返回值: 返回给定值的双曲余弦值

注 意:cosh(x)=(e^x+e^(-x))/2 


程序例: 计算x弧度的双曲线余弦值,并将结果输出

#include<math.h>

#include<stdio.h>

int main(void){

   double result;

   double x = 0.5;

   result = cosh(x);

   printf("The hyperboic cosine of %lf is %lf\n", x, result);

   return 0;

}

 

运行结果:

The hyperboic cosine of 0.500000 is 1.127626



本文固定URL:https://www.dotcpp.com/course/486

C语言函数库
<assert.h>头文件
<ctype.h>头文件
<float.h>头文件
<io.h>头文件
<math.h>头文件
<mem.h>头文件
<setjmp.h>头文件
<stdio.h>头文件
<stdlib.h>头文件
<sigal.h>头文件
<string.h>头文件
<time.h>头文件
Dotcpp在线编译      (登录可减少运行等待时间)