Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Calcule la tangente hyperbolique.
Syntaxe
double tanh( double x );
float tanhf( float x );
long double tanhl( long double x );
#define tanh(x) // Requires C11 or later
float tanh( float x ); // C++ only
long double tanh( long double x ); // C++ only
Paramètres
x
Angle en radians.
Valeur retournée
Les fonctions tanh retournent la tangente hyperbolique de x. Il n’existe aucun retour d’erreur.
| Input | Exception SEH | Exception _matherr |
|---|---|---|
| ± QNaN, IND | Aucune | _DOMAIN |
Notes
C++ autorisant la surcharge, vous pouvez appeler des surcharges de tanh qui acceptent et retournent des valeurs float ou long double. Dans un programme C, sauf si vous utilisez la <tgmath.h> macro pour appeler cette fonction, tanh prend toujours et retourne double.
Si vous utilisez la tanh macro à partir de <tgmath.h>laquelle , le type de l’argument détermine la version de la fonction sélectionnée. Pour plus d’informations, consultez les mathématiques génériques de type.
Par défaut, l’état global de cette fonction est limité à l’application. Pour modifier ce comportement, consultez État global dans le CRT.
Spécifications
| Routine | En-tête requis (C) | En-tête requis (C) |
|---|---|---|
tanh, , tanhftanhl |
<math.h> |
<cmath> ou <math.h> |
Macro tanh |
<tgmath.h> |
Pour plus d’informations sur la compatibilité, consultez Compatibility.
Exemple
// crt_tanh.c
// This program displays the tangent of pi / 4
// and the hyperbolic tangent of the result.
// Compile by using: cl crt_tanh.c
#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 );
}
tan( 0.785398 ) = 1.000000
tanh( 1.000000 ) = 0.761594
Voir aussi
Prise en charge des fonctions mathématiques et à virgule flottante
acosh, , acoshfacoshl
asinh, , asinhfasinhl
atanh, , atanhfatanhl
cosh, , coshfcoshl
sinh, , sinhfsinhl