Computes the tangent of a radian value.
#include <math.h> double tan(double x); float tanf(float x); long double tanl(long double x);
x
A floating point value, in radians.
These functions compute the tangent of x. If x is close to an odd multiple of pi divided by 2, these functions assign errno to EDOM. Use fpclassify() to check the validity of the results returned by these functions.
This facility may not be available on configurations of the EWL that run on platforms that do not have floating-point math capabilities.
#include <math.h> #include <stdio.h> int main(void) { double x = 0.5; printf("The tangent of %f is %f.\n", x, tan(x)); return 0; } Output: The tangent of 0.500000 is 0.546302.