Namespaces
Variants

std:: sinh, std:: sinhf, std:: sinhl

From cppreference.net
Common mathematical functions
Nearest integer floating point operations
(C++11)
(C++11)
(C++11) (C++11) (C++11)
Floating point manipulation functions
(C++11) (C++11)
(C++11)
(C++11)
Classification and comparison
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Types
(C++11)
(C++11)
(C++11)
Macro constants
Definiert im Header <cmath>
(1)
float sinh ( float num ) ;

double sinh ( double num ) ;

long double sinh ( long double num ) ;
(bis C++23)
/*floating-point-type*/
sinh ( /*floating-point-type*/ num ) ;
(seit C++23)
(constexpr seit C++26)
float sinhf ( float num ) ;
(2) (seit C++11)
(constexpr seit C++26)
long double sinhl ( long double num ) ;
(3) (seit C++11)
(constexpr seit C++26)
SIMD-Überladung (seit C++26)
Definiert im Header <simd>
template < /*math-floating-point*/ V >

constexpr /*deduced-simd-t*/ < V >

sinh ( const V & v_num ) ;
(S) (seit C++26)
Definiert im Header <cmath>
template < class Integer >
double sinh ( Integer num ) ;
(A) (constexpr seit C++26)
1-3) Berechnet den hyperbolischen Sinus von num . Die Bibliothek bietet Überladungen von std::sinh für alle cv-unqualifizierten Gleitkommatypen als Typ des Parameters an. (since C++23)
S) Die SIMD-Überladung führt eine elementweise std::sinh -Operation auf v_num durch.
(Siehe math-floating-point und deduced-simd-t für deren Definitionen.)
(seit C++26)
A) Zusätzliche Überladungen werden für alle Ganzzahltypen bereitgestellt, die als double behandelt werden.
(since C++11)

Inhaltsverzeichnis

Parameter

num - Gleitkomma- oder Ganzzahlwert

Rückgabewert

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

Wenn ein Bereichsfehler aufgrund von Überlaufs 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 Underflows num 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.

Die zusätzlichen Überladungen müssen nicht exakt wie (A) bereitgestellt werden. Sie müssen lediglich sicherstellen, dass für ihr Argument num vom Ganzzahltyp std :: sinh ( num ) die gleiche Wirkung hat wie std :: sinh ( static_cast < double > ( num ) ) .

Beispiel

#include <cerrno>
#include <cfenv>
#include <cmath>
#include <cstring>
#include <iostream>
// #pragma STDC FENV_ACCESS ON
int main()
{
    const double x = 42;
    std::cout << "sinh(1) = " << std::sinh(1) << '\n'
              << "sinh(-1) = " << std::sinh(-1) << '\n'
              << "log(sinh(" << x << ")+cosh(" << x << ")) = "
              << std::log(std::sinh(x) + std::cosh(x)) << '\n';
    // special values
    std::cout << "sinh(+0) = " << std::sinh(0.0) << '\n'
              << "sinh(-0) = " << std::sinh(-0.0) << '\n';
    // error handling
    errno = 0;
    std::feclearexcept(FE_ALL_EXCEPT);
    std::cout << "sinh(710.5) = " << std::sinh(710.5) << '\n';
    if (errno == ERANGE)
        std::cout << "    errno == ERANGE: " << std::strerror(errno) << '\n';
    if (std::fetestexcept(FE_OVERFLOW))
        std::cout << "    FE_OVERFLOW raised\n";
}

Ausgabe:

sinh(1) = 1.1752
sinh(-1) = -1.1752
log(sinh(42)+cosh(42)) = 42
sinh(+0) = 0
sinh(-0) = -0
sinh(710.5) = inf
    errno == ERANGE: Numerical result out of range
    FE_OVERFLOW raised

Siehe auch

(C++11) (C++11)
berechnet den hyperbolischen Kosinus ( cosh(x) )
(Funktion)
(C++11) (C++11)
berechnet den hyperbolischen Tangens ( tanh(x) )
(Funktion)
(C++11) (C++11) (C++11)
berechnet den Areasinus Hyperbolicus ( arsinh(x) )
(Funktion)
berechnet den hyperbolischen Sinus einer komplexen Zahl ( sinh(z) )
(Funktions-Template)
wendet die Funktion std::sinh auf jedes Element des Valarray an
(Funktions-Template)