Namespaces
Variants

std:: asinh, std:: asinhf, std:: asinhl

From cppreference.net
Common mathematical functions
Nearest integer floating point operations
(C++11)
(C++11)
(C++11) (C++11) (C++11)
Floating point manipulation functions
(C++11) (C++11)
(C++11)
(C++11)
Classification and comparison
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Types
(C++11)
(C++11)
(C++11)
Macro constants
定义于头文件 <cmath>
(1)
float asinh ( float num ) ;

double asinh ( double num ) ;

long double asinh ( long double num ) ;
(C++23 前)
/*floating-point-type*/
asinh ( /*floating-point-type*/ num ) ;
(C++23 起)
(C++26 起为 constexpr)
float asinhf ( float num ) ;
(2) (C++11 起)
(C++26 起为 constexpr)
long double asinhl ( long double num ) ;
(3) (C++11 起)
(C++26 起为 constexpr)
SIMD 重载 (C++26 起)
定义于头文件 <simd>
template < /*math-floating-point*/ V >

constexpr /*deduced-simd-t*/ < V >

asinh ( const V & v_num ) ;
(S) (C++26 起)
额外重载 (C++11 起)
定义于头文件 <cmath>
template < class Integer >
double asinh ( Integer num ) ;
(A) (C++26 起为 constexpr)
1-3) 计算 num 的反双曲正弦。 库为所有 cv 未限定浮点类型提供了 std::asinh 的重载,作为参数类型。 (since C++23)
S) SIMD 重载对 v_num 执行逐元素的 std::asinh 运算。
(定义参见 math-floating-point deduced-simd-t 。)
(since C++26)
A) 为所有整数类型提供了额外的重载,这些类型被视为 double
(since C++11)

目录

参数

num - 浮点数或整数值

返回值

若无错误发生,则返回 num 的反双曲正弦值( sinh -1
(num)
,或 arsinh(num) )。

如果由于下溢发生范围错误,将返回正确结果(舍入后)。

错误处理

错误报告方式遵循 math_errhandling 中的规范。

如果实现支持 IEEE 浮点算术 (IEC 60559),

  • 如果参数为 ±0 或 ±∞,则原样返回。
  • 如果参数为 NaN,则返回 NaN。

注释

尽管C标准(C++在此函数上引用该标准)将此函数命名为“反双曲正弦”,但双曲函数的反函数实际上是面积函数。它们的参数是双曲扇形的面积,而非弧长。正确的名称应为“反双曲正弦”(POSIX使用)或“面积双曲正弦”。

额外的重载并不要求完全按照 (A) 的形式提供。只需确保对于整数类型的实参 num std :: asinh ( num ) 能够产生与 std :: asinh ( static_cast < double > ( num ) ) 相同的效果即可。

示例

#include <cmath>
#include <iostream>
int main()
{
    std::cout << "asinh(1) = " << std::asinh(1) << '\n'
              << "asinh(-1) = " << std::asinh(-1) << '\n';
    // 特殊值
    std::cout << "asinh(+0) = " << std::asinh(+0.0) << '\n'
              << "asinh(-0) = " <<  std::asinh(-0.0) << '\n';
}

输出:

asinh(1) = 0.881374
asinh(-1) = -0.881374
asinh(+0) = 0
asinh(-0) = -0

另请参阅

(C++11) (C++11) (C++11)
计算反双曲余弦( arcosh(x)
(函数)
(C++11) (C++11) (C++11)
计算反双曲正切( artanh(x)
(函数)
(C++11) (C++11)
计算双曲正弦( sinh(x)
(函数)
计算复数的反双曲正弦( arsinh(z)
(函数模板)
C 文档 for asinh

外部链接

魏斯坦, 埃里克·W。《反双曲正弦函数》 摘自 MathWorld —— 沃尔夫勒姆网络资源。