?
This document uses PHP Chinese website manual Release
在頭文件<math.h>中定義 | ||
---|---|---|
float sinhf(float arg); | (1) | (自C99以來) |
double sinh(double arg); | (2) | |
long double sinhl(long double arg); | (3) | (自C99以來) |
在頭文件<tgmath.h>中定義 | ||
#define sinh(生氣) | (4) | (自C99以來) |
1-3)計算雙曲正弦arg
。
4)類型 - 通用宏:如果參數(shù)具有類型long double
,sinhl
則被調(diào)用。否則,如果參數(shù)具有整數(shù)類型或類型double
,sinh
則調(diào)用該參數(shù)。否則,sinhf
被調(diào)用。如果參數(shù)是復(fù)雜的,則宏調(diào)用相應(yīng)的復(fù)變函數(shù)(csinhf
,csinh
,csinhl
)。
arg | - | 浮點值代表雙曲線角度 |
---|
如果沒有錯誤發(fā)生,arg
(sinh(arg)或者雙曲正弦
| earg-e-arg |
|:----|
| 2 |
)返回。
如果范圍誤差由于發(fā)生溢出,±HUGE_VAL
,±HUGE_VALF
,或±HUGE_VALL
返回。
如果由于下溢而發(fā)生范圍錯誤,則返回正確的結(jié)果(舍入后)。
按照math_errhandling中的指定報告錯誤。
如果實現(xiàn)支持IEEE浮點運(yùn)算(IEC 60559),
如果參數(shù)為±0或±∞,則不加修改地返回
如果參數(shù)是NaN,則返回NaN
POSIX指定在發(fā)生下溢時,arg
未經(jīng)修改就返回,如果不支持,則返回不大于DBL_MIN,F(xiàn)LT_MIN和LDBL_MIN的實現(xiàn)定義值。
#include <stdio.h>#include <math.h>#include <errno.h>#include <fenv.h> #pragma STDC FENV_ACCESS ON int main(void){ printf("sinh(1) = %f\nsinh(-1)=%f\n", sinh(1), sinh(-1)); printf("log(sinh(1) + cosh(1))=%f\n", log(sinh(1)+cosh(1))); // special values printf("sinh(+0) = %f\nsinh(-0)=%f\n", sinh(0.0), sinh(-0.0)); // error handling errno=0; feclearexcept(FE_ALL_EXCEPT); printf("sinh(710.5) = %f\n", sinh(710.5)); if(errno == ERANGE) perror(" errno == ERANGE"); if(fetestexcept(FE_OVERFLOW)) puts(" FE_OVERFLOW raised");}
可能的輸出:
sinh(1) = 1.175201sinh(-1)=-1.175201log(sinh(1) + cosh(1))=1.000000sinh(+0) = 0.000000sinh(-0)=-0.000000sinh(710.5) = inf errno == ERANGE: Numerical result out of range FE_OVERFLOW raised
C11標(biāo)準(zhǔn)(ISO/IEC 9899:2011):
7.12.5.5 sinh函數(shù)(p:241-242)
7.25類型通用數(shù)學(xué)<tgmath.h>(p:373-375)
F.10.2.5 sinh函數(shù)(p:520)
C99標(biāo)準(zhǔn)(ISO/IEC 9899:1999):
7.12.5.5 sinh函數(shù)(p:222)
7.22類型通用數(shù)學(xué)<tgmath.h>(p:335-337)
F.9.2.5 sinh函數(shù)(p:457)
C89/C90標(biāo)準(zhǔn)(ISO/IEC 9899:1990):
4.5.3.2 sinh函數(shù)
coshcoshfcoshl(C99)(C99) | 計算雙曲余弦(ch(x))(函數(shù)) |
---|---|
tanhtanhftanhl(C99)(C99) | 計算雙曲正切(函數(shù)) |
asinhasinhfasinhl(C99)(C99)(C99) | 計算反雙曲正弦(arsinh(x))(函數(shù)) |
csinhcsinhfcsinhl(C99)(C99)(C99) | 計算復(fù)數(shù)雙曲正弦函數(shù)(函數(shù)) |