Share via


sinh, sinhf, sinhl

計算雙曲正弦值。

語法

double sinh(double x);
float sinhf(float x);
long double sinhl(long double x);
#define sinh(x) // Requires C11 or higher

float sinh(float x);  // C++ only
long double sinh(long double x);  // C++ only

參數

x
角度 (弧度)。

傳回值

sinh 函式會傳回 x 的雙曲正弦值。 根據預設,如果結果太大, sinh 請將 設定 errnoERANGE ,並傳回± HUGE_VAL

輸入 SEH 例外狀況 _matherr 例外
± QNaN,IND _DOMAIN
|x| ≥ 7.104760e+002 OVERFLOW+INEXACT OVERFLOW

如需傳回碼的詳細資訊,請參閱 errno_doserrno_sys_errlist_sys_nerr

備註

因為 C++ 允許多載,所以您可以呼叫採用並傳回 sinhfloat 值的 long double 的多載。 在 C 程式中,除非您使用 <tgmath.h> 宏來呼叫此函式, sinh 否則一律會採用 並傳 double 回 。

如果您使用 中的 sinh<tgmath.h> 宏,引數的類型會決定選取哪一個函式版本。 如需詳細資訊,請參閱 類型泛型數學

根據預設,此函式的全域狀態會限定于應用程式。 若要變更此行為,請參閱 CRT 中的全域狀態。

需求

常式 必要的標頭 (C) 必要的標頭 (C++)
sinh, sinhf, sinhl <math.h> <cmath><math.h>
sinh 宏觀 <tgmath.h>

如需相容性詳細資訊,請參閱相容性

範例

// crt_sinhcosh.c
// This program displays the hyperbolic
// sine and hyperbolic cosine of pi / 2.
// Compile by using: cl /W4 crt_sinhcosh.c

#include <math.h>
#include <stdio.h>

int main( void)
{
   double pi = 3.1415926535;
   double x, y;

   x = pi / 2;
   y = sinh( x );
   printf( "sinh( %f ) = %f\n",x, y );
   y = cosh( x );
   printf( "cosh( %f ) = %f\n",x, y );
}
sinh( 1.570796 ) = 2.301299
cosh( 1.570796 ) = 2.509178

另請參閱

數學和浮點支援
acosh, acoshf, acoshl
asinh, asinhf, asinhl
atanh, atanhf, atanhl
cosh, coshf, coshl
tanh, tanhf, tanhl