Namespaces
Variants

sinh, sinhf, sinhl

From cppreference.net
< c ‎ | numeric ‎ | math
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99) (C99) (C99) (C23)
Maximum/minimum operations
Exponential functions
Power functions
Trigonometric and hyperbolic functions
Nearest integer floating-point
(C99) (C99) (C99)
(C23) (C23) (C23) (C23)
Floating-point manipulation
Narrowing operations
(C23)
(C23)
(C23)
(C23)
(C23)
(C23)
Quantum and quantum exponent
Decimal re-encoding functions
Total order and payload functions
Classification
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Types
Macro constants
Special floating-point values
Arguments and return values
Error handling
Fast operation indicators
ヘッダーで定義 <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( arg )
(4) (C99以降)
1-3) 双曲線正弦を計算します( arg の)。
4) 型総称マクロ: 引数の型が long double の場合、 sinhl が呼び出される。そうでなく、引数が整数型または double 型の場合、 sinh が呼び出される。それ以外の場合、 sinhf が呼び出される。引数が複素数の場合、マクロは対応する複素数関数( csinhf csinh csinhl )を呼び出す。

目次

翻訳の説明: - 「Contents」を「目次」に翻訳しました - HTMLタグ、属性、クラス名はすべて保持されています - C++関連の専門用語(Parameters、Return value、Error handling、Notes、Example、References、See also)は翻訳せずに保持されています - 数値や構造は完全に保持されています - フォーマットとインデントは元のまま維持されています

パラメータ

arg - 双曲角を表す浮動小数点値

戻り値

If no errors occur, the hyperbolic sine of arg ( sinh(arg) , or
e arg
-e -arg
2
) is returned.

オーバーフローによる範囲エラーが発生した場合、 ±HUGE_VAL ±HUGE_VALF または ±HUGE_VALL が返されます。

アンダーフローによる範囲エラーが発生した場合、正しい結果(丸め後)が返されます。

エラー処理

エラーは math_errhandling で指定された通りに報告されます。

IEEE浮動小数点演算(IEC 60559)を実装がサポートしている場合、

  • 引数が±0または±∞の場合、変更されずに返されます、
  • 引数がNaNの場合、NaNが返されます。

注記

POSIXは アンダーフローが発生した場合、 arg が変更されずに返され、それがサポートされていない場合は、 DBL_MIN FLT_MIN 、および LDBL_MIN を超えない実装定義の値が返されることを規定しています。

#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <stdio.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)));
    // 特殊値
    printf("sinh(+0) = %f\nsinh(-0)=%f\n", sinh(0.0), sinh(-0.0));
    // エラー処理
    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.175201
sinh(-1)=-1.175201
log(sinh(1) + cosh(1))=1.000000
sinh(+0) = 0.000000
sinh(-0)=-0.000000
sinh(710.5) = inf
    errno == ERANGE: Numerical result out of range
    FE_OVERFLOW raised

参考文献

  • C23規格 (ISO/IEC 9899:2024):
  • 7.12.5.5 sinh関数群 (p: TBD)
  • 7.25 総称数学 <tgmath.h> (p: TBD)
  • F.10.2.5 sinh関数群 (p: TBD)
  • C17規格 (ISO/IEC 9899:2018):
  • 7.12.5.5 sinh関数群 (p: 176)
  • 7.25 総称数学 <tgmath.h> (p: 272-273)
  • F.10.2.5 sinh関数群 (p: 379)
  • C11規格 (ISO/IEC 9899:2011):
  • 7.12.5.5 sinh関数 (p: 241-242)
  • 7.25 総称数学 <tgmath.h> (p: 373-375)
  • F.10.2.5 sinh関数 (p: 520)
  • C99規格 (ISO/IEC 9899:1999):
  • 7.12.5.5 sinh関数群 (p: 222)
  • 7.22 総称数学 <tgmath.h> (p: 335-337)
  • F.9.2.5 sinh関数群 (p: 457)
  • C89/C90標準 (ISO/IEC 9899:1990):
  • 4.5.3.2 sinh関数

関連項目

(C99) (C99)
双曲線余弦を計算する ( cosh(x) )
(関数)
(C99) (C99)
双曲線正接を計算する ( tanh(x) )
(関数)
(C99) (C99) (C99)
逆双曲線正弦を計算する ( arsinh(x) )
(関数)
(C99) (C99) (C99)
複素双曲線正弦を計算する
(関数)