CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Pages

Valid RSS

CMath.h

tan

About | FAQ | Contact
About FAQ Contact

Tangent function

viewed 13860 times


+View other versions (3)
Contents -

Interface

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

#include <complex.h>
complex tan (complex x)
double complex ctan (double complex x)
float complex ctan (float complex x)
long double complex ctanl (long double complex x)

Description

The tan function computes the tangent of x (measured in radians). This is identical to the calculation of
Example 1:
#include <stdio.h>
#include <math.h>
 
int main()
{
  double x = 0.3333;
  double result = tan(x);
  printf("The tangent of %.4lf is %.4lf\n", x, result);
  return 0;
}

Output:
The tangent of 0.3333 is 0.3462

Special Values

tan ( ±0 ) returns ±0.
tan ( ±∞ ) returns a NaN and raises the invalid floating-point exception.

See Also

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

Standards

The tan function conforms to ISO/IEC 9899:1999(E).

Compatibility

DOSUNIXWindowsANSI CC++ only
tanl
Real tan
Complex tan
Complex ctan

Last Modified: 2009-11-01 08:42:34     Page Rendered: 2010-03-14 12:36:11

Page Comments

Format Excel Equations

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional