Freigeben über


sin, sinf, sinl, sinh, sinhf, sinhl

Berechnet Sinusse und hyperbolische Sinusse.

double sin(
   double x 
);
float sin(
   float x
);  // C++ only
long double sin(
   long double x
);  // C++ only
float sinf(
   float x 
);
long double sinl(
   long double x
);
double sinh(
   double x 
);
float sinh(
   float x 
);  // C++ only
long double sinh(
   long double x
);  // C++ only
float sinhf(
   float x
);
long double sinhl(
   long double x
);

Parameter

  • x
    Winkel im Bogenmaß.

Rückgabewert

Die sin-Funktionen geben den Sinus von x zurück. Wenn x größer oder gleich 263 oder kleiner oder gleich – 263 ist, kommt es im Ergebnis zu einem Bedeutungsverlust.

Die sinh-Funktionen geben den hyperbolischen Sinus von x zurück. Wenn das Ergebnis zu groß ist, legt sinh standardmäßig errno auf ERANGE fest und gibt ±HUGE_VAL zurück.

Eingabe

SEH-Ausnahme

Matherr-Ausnahme

± QNAN,IND

Kein

_DOMAIN

± ∞ (sin, sinf, sinl)

INVALID

_DOMAIN

|x| ≥ 7,104760e+002 (sinh, sinhf, sinhl)

OVERFLOW+INEXACT

OVERFLOW

Weitere Informationen zu Rückgabecodes finden Sie unter errno, _doserrno, _sys_errlist und _sys_nerr.

Hinweise

Da C++ das Überladen zulässt, können Sie Überladungen von sin und sinh aufrufen, die float- oder long double-Werte verwenden und zurückgeben. In einem C-Programm verwenden sin und sinh immer double und geben "Double" auch zurück.

Anforderungen

Routine

Erforderlicher Header

sin, sinf, sinl, sinh, sinhf, sinhl

<math.h>

Zusätzliche Informationen zur Kompatibilität finden Sie unter Kompatibilität.

Beispiel

// crt_sincos.c
// This program displays the sine, hyperbolic
// sine, cosine, and hyperbolic cosine of pi / 2.
//

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

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

   x = pi / 2;
   y = sin( x );
   printf( "sin( %f ) = %f\n", x, y );
   y = sinh( x );
   printf( "sinh( %f ) = %f\n",x, y );
   y = cos( x );
   printf( "cos( %f ) = %f\n", x, y );
   y = cosh( x );
   printf( "cosh( %f ) = %f\n",x, y );
}
  

.NET Framework-Entsprechung

Siehe auch

Referenz

Gleitkommaunterstützung

acos, acosf, acosl

asin, asinf, asinl

atan, atanf, atanl, atan2, atan2f, atan2l

cos, cosf, cosl, cosh, coshf, coshl

tan, tanf, tanl, tanh, tanhf, tanhl

_CIsin