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

C++ Math acosh()

C++ Math acosh()

该函数计算以弧度表示的角度的反双曲余弦值。
其中,弧双曲余弦是双曲余弦的逆运算。
cosh-1x = acosh(x); 

语法

假设角度为" x":
float acosh(float x);
double acosh(double x);
long double acosh(long double x);
double acosh(integral x);

参数

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

返回值

它返回x的双曲余弦值。

示例1

让我们看一个简单的示例,当度值为整数时类型。
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
    int degree =30;
    float x = degree*3.14/180;
    std::cout << "Value of degree is : " <<degree<< std::endl;
    cout<<"cosh(x) : "<<cosh(x)<<'\n';
    cout<<"acosh(x) : "<<acosh(x);
    return 0;
}
输出:
Value of degree is : 30
cosh(x) : 1.14009
acosh(x) :-nan   
在此示例中,acosh()函数计算x的反双曲余弦并返回值-nan。

示例2

让我们看看一个简单的示例,当度的值为浮点型时。
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
    int degree =15.7;
    float x = degree*3.14/180;
    std::cout << "Value of degree is : " <<degree<< std::endl;
    cout<<"cosh(x) : "<<cosh(x)<<'\n';
    cout<<"acosh(x) : "<<acosh(x);
    return 0;
}
输出:
Value of degree is : 15.7
cosh(x) : 1.03443
acosh(x) :-nan   
在此示例中,acosh()计算x的反双曲余弦并返回值-nan。

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