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
Definiert im Header <math.h>
float sinhf ( float arg ) ;
(1) (seit C99)
double sinh ( double arg ) ;
(2)
long double sinhl ( long double arg ) ;
(3) (seit C99)
Definiert im Header <tgmath.h>
#define sinh( arg )
(4) (seit C99)
1-3) Berechnet den hyperbolischen Sinus von arg .
4) Typgenerisches Makro: Wenn das Argument den Typ long double hat, wird sinhl aufgerufen. Andernfalls, wenn das Argument ganzzahligen Typ oder den Typ double hat, wird sinh aufgerufen. Andernfalls wird sinhf aufgerufen. Wenn das Argument komplex ist, ruft das Makro die entsprechende komplexe Funktion auf ( csinhf , csinh , csinhl ).

Inhaltsverzeichnis

Parameter

arg - Fließkommawert, der einen hyperbolischen Winkel darstellt

Rückgabewert

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

Wenn ein Bereichsfehler aufgrund von Überlauf auftritt, ±HUGE_VAL , ±HUGE_VALF , oder ±HUGE_VALL wird zurückgegeben.

Wenn ein Bereichsfehler aufgrund von Unterlauf auftritt, wird das korrekte Ergebnis (nach Rundung) zurückgegeben.

Fehlerbehandlung

Fehler werden gemeldet, wie in math_errhandling spezifiziert.

Wenn die Implementierung IEEE-Gleitkommaarithmetik (IEC 60559) unterstützt,

  • wenn das Argument ±0 oder ±∞ ist, wird es unverändert zurückgegeben,
  • wenn das Argument NaN ist, wird NaN zurückgegeben.

Hinweise

POSIX spezifiziert , dass im Fall eines Unterlaufs arg unverändert zurückgegeben wird, und falls dies nicht unterstützt wird, ein implementierungsdefinierter Wert nicht größer als DBL_MIN , FLT_MIN , und LDBL_MIN zurückgegeben wird.

Beispiel

#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)));
    // 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");
}

Mögliche Ausgabe:

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

Referenzen

  • C23-Standard (ISO/IEC 9899:2024):
  • 7.12.5.5 Die sinh-Funktionen (S.: TBD)
  • 7.25 Typgenerische Mathematik <tgmath.h> (S.: TBD)
  • F.10.2.5 Die sinh-Funktionen (S.: TBD)
  • C17-Standard (ISO/IEC 9899:2018):
  • 7.12.5.5 Die sinh-Funktionen (S. 176)
  • 7.25 Typgenerische Mathematik <tgmath.h> (S. 272-273)
  • F.10.2.5 Die sinh-Funktionen (S. 379)
  • C11-Standard (ISO/IEC 9899:2011):
  • 7.12.5.5 Die sinh-Funktionen (S. 241-242)
  • 7.25 Typgenerische Mathematik <tgmath.h> (S. 373-375)
  • F.10.2.5 Die sinh-Funktionen (S. 520)
  • C99-Standard (ISO/IEC 9899:1999):
  • 7.12.5.5 Die sinh-Funktionen (S. 222)
  • 7.22 Typgenerische Mathematik <tgmath.h> (S. 335-337)
  • F.9.2.5 Die sinh-Funktionen (S. 457)
  • C89/C90 Standard (ISO/IEC 9899:1990):
  • 4.5.3.2 Die sinh-Funktion

Siehe auch

(C99) (C99)
berechnet den hyperbolischen Kosinus ( cosh(x) )
(Funktion)
(C99) (C99)
berechnet den hyperbolischen Tangens ( tanh(x) )
(Funktion)
(C99) (C99) (C99)
berechnet den Areahyperbelsinus ( arsinh(x) )
(Funktion)
(C99) (C99) (C99)
berechnet den komplexen hyperbolischen Sinus
(Funktion)