acosh(x)函数详解

首页 / C++入门教程 / acosh(x)函数详解

该函数计算以弧度表示的角度的双曲余弦值。

其中,反双曲余弦是双曲余弦的逆运算。

cosh-1x = acosh(x);

acosh - 语法

假设角度为" x":

float acosh(float x);
double acosh(double x);
long double acosh(long double x);
double acosh(integral x);

acosh - 参数

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

acosh - 返回值

它返回x的反双曲余弦值。

acosh - 例子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值。

链接:https://www.learnfk.comhttps://www.learnfk.com/c++/cpp-math-acosh-function.html

来源:LearnFk无涯教程网

acosh - 例子2

让我们看一个简单的例子,当degree的值是float类型时。

#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值。

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

Vue开发实战 -〔唐金州〕

后端技术面试 38 讲 -〔李智慧〕

人人都能学会的编程入门课 -〔胡光〕

Electron开发实战 -〔邓耀龙〕

Selenium自动化测试实战 -〔郭宏志〕

动态规划面试宝典 -〔卢誉声〕

性能优化高手课 -〔尉刚强〕

人人都用得上的数字化思维课 -〔付晓岩〕

Kubernetes入门实战课 -〔罗剑锋〕

好记忆不如烂笔头。留下您的足迹吧 :)