Name

tan, tanf, tanl
- tangent functions

Library

libm.lib

Synopsis

  #include <math.h>
  double tan (double x);
  float tanf (float x);
  long double tanl (long double x);

Return values

The tan function returns the tangent value.

Detailed description

The tan and tanf functions compute the tangent of x (measured in radians). A large magnitude argument may yield a result with little or no significance. The function tanl is an alias to the function tan

Examples

#include <math.h>
int main( )
{
   double pi_by_4 = 0.7853981633974483096156608458198757;
   double y;
   y = tan( pi_by_4 );
   printf( "tan( %f)  = %f\n", pi_by_4,  y );
   y = tanf( pi_by_4);
   printf( "tanf( %f) = %f\n", pi_by_4, y );
   y = tanl( pi_by_4);
   printf( "tanl( %f) = %f\n\n", pi_by_4, y );
}

         

Output

tan ( 0.7853981633974483096156608458198757 ) = 1.000000
tanf( 0.7853981633974483096156608458198757 ) = 1.000000
tanl( 0.7853981633974483096156608458198757; ) =1.000000

         


See also

acos, asin, atan, atan2, cos, cosh, math, sin, sinh, tanh

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top