tan, tanl
Go Up to math.h Index
Header File
math.h
Category
Math Routines
Prototype
double tan(double x);
long double tanl(long double x);
Description
Calculates the tangent.
tan calculates the tangent. Angles are specified in radians.
tanl is the long double version; it takes a long double argument and returns a long double result. Error handling for these routines can be modified through the functions _matherr and _matherrl.
Return Value
tan and tanl return the tangent of x, sin(x)/cos(x).
Example
#include <stdio.h> #include <math.h> int main(void) { double result, x; x = 0.5; result = tan(x); printf("The tan of %lf is %lf\n", x, result); return 0; }
Portability
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
tan |
+ |
+ |
+ |
+ |
tanl |
+ |
+ |
+ |