tanh, tanhl
Nach oben zu math.h - Index
Header-Datei
math.h
Kategorie
Mathematische Routinen
Prototyp
double tanh(double x);
long double tanhl(long double x);
Beschreibung
Berechnet den hyperbolischen Tangens.
tanh berechnet den hyperbolischen Tangens, also sinh(x)/cosh(x).
tanhl ist die long double-Version. Sie benötigt ein Argument vom Typ long double und gibt ein Ergebnis vom Typ long double zurück. Die Fehlerbehandlung für diese Funktionen kann über die Funktionen _matherr und _matherrl geändert werden.
Rückgabewert
tanh und tanhl geben den hyperbolischen Tangens von x zurück.
Beispiel
#include ltstdio.h>
#include <math.h>
int main(void)
{
double result, x;
x = 0.5;
result = tanh(x);
printf("The hyperbolic tangent of %lf is %lf\n", x, result);
return 0;
}
Portabilität
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
tanh |
+ |
+ |
+ |
+ |
tanhl |
+ |
+ |
+ |