cosh()函数以及C ++中的示例
C++cosh()函数
cosh()函数是cmath标头的库函数,用于查找给定值(双曲线角)的双曲余弦,它接受数字(x)并返回x的双曲余弦。
cosh()函数语法:
cosh(x);
参数:x–是用于计算双曲余弦的数字(双曲天使)。
返回值:double-返回双精度类型值,即双曲角度x的双曲余弦值。
示例
Input:
float x = 2.45;
Function call:
cosh(x);
Output:
5.83732C++代码演示cosh()函数示例
//示例
//cosh()功能
#include <iostream>
#include <cmath>
using namespace std;
//main()部分
int main(){
float x;
x = -10.23;
cout<<"cosh("<<x<<"): "<<cosh(x)<<endl;
x = 0;
cout<<"cosh("<<x<<"): "<<cosh(x)<<endl;
x = 2.45;
cout<<"cosh("<<x<<"): "<<cosh(x)<<endl;
return 0;
}输出结果
cosh(-10.23): 13861.2 cosh(0): 1 cosh(2.45): 5.83732
参考:C++cosh()函数