std::sinh, std::sinhf, std::sinhl_C++中文网

定义于头文件 <cmath>

(1)

float       sinh ( float arg );

float       sinhf( float arg );

(C++11 起)

double      sinh ( double arg );

(2)
(3)

long double sinh ( long double arg );

long double sinhl( long double arg );

(C++11 起)

double      sinh ( IntegralType arg );

(4) (C++11 起)

1-3) 计算 arg 的双曲正弦。

4) 接受任何整数类型参数的重载集或函数模板。等价于 2) (将参数转型为 double )。

参数

返回值

若不出现错误,则返回 arg 的双曲正弦( sinh(arg) )。

若出现上溢所致的值域错误,则返回 ±HUGE_VAL±HUGE_VALF±HUGE_VALL

若出现下溢所致的值域错误,则返回(舍入后的)正确结果。

错误处理

报告 math_errhandling 中指定的错误。

若实现支持 IEEE 浮点算术( IEC 60559 ),则

  • 若参数为 ±0 或 ±∞ ,则返回不修改的参数
  • 若参数为 NaN ,则返回 NaN

注意

POSIX 指定在下溢情况下,返回不修改的 arg ,而若不支持如此,则返回不大于 DBL_MIN 、 FLT_MIN 和 LDBL_MIN 的实现定义值。

示例

输出:

sinh(1) = 1.1752
sinh(-1) = -1.1752
log(sinh(1)+cosh(1)) = 1
sinh(+0) = 0
sinh(-0) = -0
sinh(710.5) = inf
    errno == ERANGE: Numerical result out of range
    FE_OVERFLOW raised

参阅