Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tan, tanf, tanl - Tangens

&pagelevel(4)&pagelevel

Definition

#include <math.h>

double tan(double x);
float tanf(float x); (C11)
long double tanl(long double x); (C11)

Diese Funktionen berechnen im zulässigen Gleitkommaintervall die trigonometrische Funktion Tangens. x gibt den Winkel im Bogenmaß an.

Returnwert

tan(x)

für eine zulässige Gleitkommazahl x.

 

+/-HUGE_VAL
+/-HUGE_VALF
+/-HUGE_VALL

abhängig vom Funktionstyp und Vorzeichen von x, bei Überlauf.
Zusätzlich wird errno auf ERANGE gesetzt (Resultat zu groß).

Beispiel

Folgendes Programm gibt den Tangens einer eingelesenen Zahl aus.

#include <math.h>
#include <stdio.h>
int main(void)
{
     double x;
     printf("Geben Sie bitte eine Zahl ein :\n");
     scanf("%lf", &x);
     printf("Der Tangens von %g ist %g \n", x, tan(x));
     return 0;
}

Siehe auch

sin, cos, tanh, atan