函式
<cmath> <ctgmath>

sinh

double sinh (double x);
     double sinh  (double x);      float sinhf (float x);long double sinhl (long double x);
     double sinh (double x);      float sinh (float x);long double sinh (long double x);
     double sinh (double x);      float sinh (float x);long double sinh (long double x);     double sinh (T x);           // additional overloads for integral types
計算雙曲正弦
返回 x 的雙曲正弦。

標頭檔案 <tgmath.h> 提供了此函式的型別通用宏版本。
此函式在 <complex><valarray> 中被過載(參見 complex sinhvalarray sinh)。
此標頭檔案 (<cmath>) 為整型提供了額外的過載:這些過載在計算前有效地將 x 轉換為 double(為任何整型 T 定義)。

此函式也在 <complex><valarray> 中被過載(參見 complex sinhvalarray sinh)。

引數

x
表示雙曲角的值。

返回值

x 的雙曲正弦。
如果結果的絕對值太大,無法用返回型別的值表示,則函式返回帶有正確符號的 HUGE_VAL(或 HUGE_VALFHUGE_VALL),併發生上溢範圍錯誤

如果發生上溢範圍錯誤,全域性變數 errno 會被設定為 ERANGE
如果發生上溢範圍錯誤
- 並且 math_errhandling 設定了 MATH_ERRNO:全域性變數 errno 被設定為 ERANGE
- 並且 math_errhandling 設定了 MATH_ERREXCEPT:將引發 FE_OVERFLOW

示例

1
2
3
4
5
6
7
8
9
10
11
12
/* sinh example */
#include <stdio.h>      /* printf */
#include <math.h>       /* sinh, log */

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;
}

輸出

The hyperbolic sine of 0.693147 is 0.750000.


另見