double tan (double x);
double tan (double x); float tanf (float x);long double tanl (long double x);
double tan (double x); float tan (float x);long double tan (long double x);
double tan (double x); float tan (float x);long double tan (long double x); double tan (T x); // additional overloads for integral types
<cmath> ) for the integral types: These overloads effectively cast x to a double before calculations (defined for T being any integral type ).<complex> and <valarray> (see complex tan and valarray tan).180/PI degrees.1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* tan example */
#include <stdio.h> /* printf */
#include <math.h> /* tan */
#define PI 3.14159265
int main ()
{
double param, result;
param = 45.0;
result = tan ( param * PI / 180.0 );
printf ("The tangent of %f degrees is %f.\n", param, result );
return 0;
}
The tangent of 45.000000 degrees is 1.000000.