该函数找到以弧度给出的角度的双曲余弦值。
数学上
coshx = ex+ e-x/2
cosh - 语法
假设双曲角为" x":
float cosh(float x); double cosh(double x); long double cosh(long double x); double cosh(integral x);
cosh - 参数
x :要计算其双曲余弦的角度值。
cosh - 返回值
它返回以弧度表示的双曲余弦角。
cosh - 例子1
让我们看一个简单的例子,当x的值是整数类型时。
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
int x=45;
float radian=x*3.14/180;
std::cout << "Value of degree is :" <<x<<std::endl;
cout<<"cosh(radian): "<<cosh(radian);
return 0;
}
输出:
Value of degree is :45 cosh(radian): 1.32426
在此示例中,cosh()计算角度为45的双曲余弦并返回值1.324。
cosh - 例子2
让我们看另一个简单的例子。
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
float x=25.5;
float radian=x*3.14/180;
std::cout << "Value of degree is: " << x<<std::endl;
cout<<"cosh(radian): "<<cosh(radian);
return 0;
}
输出:
Value of degree is: 25.5 cosh(radian): 1.10058