tan, tanf, tanh, tanhf
Visual Studio 2008
Calculate the tangent (tan or tanf) or hyperbolic tangent (tanh or 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 );
Routine | Required header |
|---|---|
tan, tanf, tanh, tanhf | <math.h> |
For additional compatibility information, see Compatibility in the Introduction.
// 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 );
}