首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::acosh

Defined in header <cmath>

?

?

float acosh( float arg );

(1)

(since C++11)

double acosh( double arg );

(2)

(since C++11)

long double acosh( long double arg );

(3)

(since C++11)

double acosh( Integral arg );

(4)

(since C++11)

的逆双曲余弦的计算arg...

4%29一组过载或接受任意参数的函数模板积分型等于2%29%28double29%。

参数

arg

-

value of a floating-point or Integral type

返回值

如果没有误差,则反双曲余弦arg%28 COSH-1

间隔时间为28 arg%29,或arcosh%28 arg%29%290,+∞,被归还。

如果发生域错误,则返回支持%29的实现定义值%28 NaN。

错误处理

错误按数学[医]错误处理...

如果参数小于1时,则会发生域错误。

如果实现支持ieee浮点算法%28IEC 60559%29,

  • 如果论点小于1,FE_INVALID被引发,则返回NaN。
  • 如果参数为1,则返回+0。
  • 如果参数为+∞,则返回+∞
  • 如果参数为nan,则返回nan。

注记

虽然C++所指的C标准%28将该函数命名为“圆弧双曲余弦”,但双曲函数的反函数是面积函数。他们的论点是双曲区,而不是弧线区。正确的名称是POSIX%29使用的“逆双曲余弦”%28或“面积双曲余弦”。

实例

二次

代码语言:javascript
复制
#include <iostream>
#include <cmath>
#include <cfloat>
#include <cerrno>
#include <cfenv>
#include <cstring>
#pragma STDC FENV_ACCESS ON
int main()
{
    std::cout << "acosh(1) = " << std::acosh(1) << '\n'
              << "acosh(10) = " << std::acosh(10) << '\n'
              << "acosh(DBL_MAX) = " << std::acosh(DBL_MAX) << '\n'
              << "acosh(Inf) = " <<  std::acosh(INFINITY) << '\n';
     // error handling 
     errno = 0; std::feclearexcept(FE_ALL_EXCEPT);
     std::cout << "acosh(0.5) = " << std::acosh(0.5) << '\n';
     if(errno == EDOM)
         std::cout << "    errno == EDOM: " << std::strerror(errno) << '\n';
     if(std::fetestexcept(FE_INVALID))
        std::cout << "    FE_INVALID raised\n";
}

二次

可能的产出:

二次

代码语言:javascript
复制
acosh(1) = 0
acosh(10) = 2.99322
acosh(DBL_MAX) = 710.476
acosh(Inf) = inf
acosh(0.5) = -nan
    errno == EDOM: Numerical argument out of domain
    FE_INVALID raised

二次

另见

asinh (C++11)

computes the inverse hyperbolic sine (arsinh(x)) (function)

atanh (C++11)

computes the inverse hyperbolic tangent (artanh(x)) (function)

cosh

computes hyperbolic cosine (ch(x)) (function)

acosh(std::complex) (C++11)

computes area hyperbolic cosine of a complex number (function template)

c ACOSH文件

外部链接

逆双曲余弦。来自MathWorld的一个Wolfram Web资源。

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com