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

std::atanh

Defined in header <cmath>

?

?

float atanh( float arg );

(1)

(since C++11)

double atanh( double arg );

(2)

(since C++11)

long double atanh( long double arg );

(3)

(since C++11)

double atanh( Integral arg );

(4)

(since C++11)

的逆双曲切线的计算arg...

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

参数

arg

-

value of a floating-point or Integral type

返回值

如果没有误差,则反双曲切线arg%28丹尼-1

返回%28 arg%29或artanh%28 arg%29%29。

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

如果发生极差,±HUGE_VAL,,,±HUGE_VALF,或±HUGE_VALL返回%28,并带有正确的符号%29。

如果由于下流而发生范围错误,则返回舍入%29后的正确结果%28。

错误处理

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

如果参数不在间隔上-1+1,则会发生范围错误。

如果参数为±1,则会出现极差。

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

  • 如果参数为±0,则返回
  • 如果参数为±1,则返回±∞FE_DIVBYZERO是被抚养的。
  • 如果Arg>1,NaN将返回FE_INVALID是被抚养的。
  • 如果参数为nan,则返回nan。

注记

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

POSIX指定如果是地下水流,arg如果不支持,则实现定义的值不大于dbl。[医]敏·弗利特[医]和LDBL[医]民回来了。

二次

代码语言:javascript
复制
#include <iostream>
#include <cmath>
#include <cfloat>
#include <cerrno>
#include <cfenv>
#include <cstring>
#pragma STDC FENV_ACCESS ON
int main()
{
    std::cout << "atanh(0) = " << std::atanh(0) << '\n'
              << "atanh(-0) = " << std::atanh(-0.0) << '\n'
              << "atanh(0.9) = " << std::atanh(0.9) << '\n';
     // error handling 
     errno = 0; std::feclearexcept(FE_ALL_EXCEPT);
     std::cout << "atanh(-1) = " << std::atanh(-1) << '\n';
     if(errno == ERANGE)
         std::cout << "    errno == ERANGE: " << std::strerror(errno) << '\n';
     if(std::fetestexcept(FE_DIVBYZERO))
        std::cout << "    FE_DIVBYZERO raised\n";
}

二次

可能的产出:

二次

代码语言:javascript
复制
atanh(0) = 0
atanh(-0) = -0
atanh(0.9) = 1.47222
atanh(-1) = -inf
    errno == ERANGE: Numerical result out of range
    FE_DIVBYZERO raised

二次

另见

asinh (C++11)

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

acosh (C++11)

computes the inverse hyperbolic cosine (arcosh(x)) (function)

tanh

hyperbolic tangent (function)

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

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

c为atanh编写的文件

外部链接

逆双曲切线。来自MathWorld的一个Wolfram Web资源。

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com