6.11.18 atanf Function
Calculates the trigonometric arc tangent function of a single precision floating-point value.
Include
<math.h>
Prototype
float atanf(float x);
Argument
x
- value for which to return the arc tangent
Return Value
Returns the arc tangent in the range of radians (inclusive).
Example
See the notes at the beginning of this chapter or section for
information on using printf()
or scanf()
(and other functions reading and writing the stdin
or
stdout
streams) in the example code.
#include <math.h>
#include <stdio.h>
int main(void)
{
float x, y;
x = 2.0F;
y = atanf (x);
printf("The arctangent of %f is %f\n", x, y);
x = -1.0F;
y = atanf (x);
printf("The arctangent of %f is %f\n", x, y);
}
Example Output
The arctangent of 2.000000 is 1.107149
The arctangent of -1.000000 is -0.785398