std::cosh, std::coshf, std::coshl_C++中文网
| 定义于头文件 |
||
| (1) | ||
| float cosh ( float arg ); |
||
| float coshf( float arg ); |
(C++11 起) | |
| double cosh ( double arg ); |
(2) | |
| (3) | ||
| long double cosh ( long double arg ); |
||
| long double coshl( long double arg ); |
(C++11 起) | |
| double cosh ( IntegralType arg ); |
(4) | (C++11 起) |
1-3) 计算 arg 的双曲余弦。
4) 接受任何整数类型参数的重载集或函数模板。等价于 2) (将参数转型为 double )。
参数
返回值
若不出现错误,则返回 arg 的双曲余弦( cosh(arg) 或 )。
若出现上溢所致的值域错误,则返回 +HUGE_VAL 、 +HUGE_VALF 或 +HUGE_VALL 。
错误处理
报告 math_errhandling 中指定的错误。
若实现支持 IEEE 浮点算术( IEC 60559 ),则
- 若参数为 ±0 ,则返回 1
- 若参数为 ±∞ ,则返回 +∞
- 若参数为 NaN ,则返回 NaN
注意
对于 IEEE 兼容的 double 类型,若 |arg| > 710.5 ,则 cosh(arg) 上溢。