C++教程
C++控制语句
C++函数
C++数组
C++指针
C++对象
C++继承
C++多态
C++抽象
C++常用
C++ STL教程
C++迭代器
C++程序

C++ Math cosh()

C++ Math cosh()

该函数查找以弧度给出的角度的双曲余弦。
Math 上
coshx = ex+ e-x/2 

语法

假设双曲角为" x":
float cosh(float x);
double cosh(double x);
long double cosh(long double x);
double cosh(integral x);

参数

x : 要计算其双曲余弦的角度值。

返回值

它返回以弧度表示的双曲余弦值。

示例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、

示例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   

昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4