tan, tanf, tanh, tanhf

Berechnet den Tangens (tan oder tanf) oder Hyperbeltangens (tanh oder tanhf).

double tan(
   double x 
);
float tan(
   float x 
);  // C++ only
long double tan(
   long double x
);  // C++ only
float tanf(
   float x 
);
double tanh(
   double x 
);
float tanh(
   float x 
);  // C++ only
long double tanh(
   long double x
);  // C++ only
float tanhf(
   float x 
);

Parameter

  • x
    Winkel im Bogenmaß.

Rückgabewert

tan gibt den Tangens von xzurück.Wenn x größer oder gleich 263 oder kleiner oder gleich 263, ist ein Verlust des Schritts im Ergebnis tritt auf.

Eingabe

SEH Ausnahme

Matherr Ausnahme

± QNAN, IND

Keine

_DOMAIN

± ∞ (tan, tanf)

INVALID

_DOMAIN

tanh gibt den Hyperbeltangens von xzurück.Es gibt keine Fehler werden.

Hinweise

C++ lässt Überladen, damit Benutzer Überladungen von tan und tanh aufrufen, die doppelte Typen float oder lange dauern.In einem C-Programm nehmen die tan und tanh-Funktionen und geben stets Double zurück.

Anforderungen

Routine

Erforderlicher Header

tan, tanf, tanh, tanhf

<math.h>

Um Kompatibilität zusätzlichen Informationen finden Sie unter Kompatibilität in der Einführung.

Beispiel

// crt_tan.c
// This program displays the tangent of pi / 4
// and the hyperbolic tangent of the result.
//

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

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

   x = tan( pi / 4 );
   y = tanh( x );
   printf( "tan( %f ) = %f\n", pi/4, x );
   printf( "tanh( %f ) = %f\n", x, y );
}
  

.NET Framework-Entsprechung

Siehe auch

Referenz

Gleitkommaunterstützung

Langes Double

acos, acosf

asin, asinf

atan, atanf, atan2, atan2f

cos, cosf, Cosh, coshf

Funktionen sin, sinf, sinh, sinhf

_CItan