C++官网参考链接:https://cplusplus.com/reference/cmath/sinh/
C90
double sinh (double x);
C99
double sinh (double x);
float sinhf (float x);
long double sinhl (long double x);
C++98
double sinh (double x);
float sinh (float x);
long double sinh (long double x);
C++11
double sinh (double x);
float sinh (float x);
long double sinh (long double x);
double sinh (T x); // additional overloads for integral types
计算双曲正弦
返回x的双曲正弦。
C99
头文件
C++98
该函数在头文件
C++11
在此头文件(
此函数在
形参
x
表示双曲角度的值。
返回值
x的双曲正弦。
如果结果的绝对大小太大,不能用返回类型的值表示,函数返回HUGE_VAL(或HUGE_VALF或HUGE_VALL)和适当的符号,并发生上溢范围错误:
C90/C++98
如果发生上溢范围错误,则将全局变量errno设置为ERANGE。
C99/C++11
如果发生上溢范围错误:
—math_errhandling具有MATH_ERRNO集合:全局变量errno设置为ERANGE。
—math_errhandling具有MATH_ERREXCEPT集合:引发FE_OVERFLOW。
用例
/* sinh example */
#include
#include
int main ()
{
double param, result;
param = log(2.0);
result = sinh (param);
printf ("The hyperbolic sine of %f is %f.\n", param, result );
return 0;
}
输出:
