atan
You can use the atan function to compute the arc tangent of a real number.
double_t atan (double_t x);
x
- Any floating-point number.
DESCRIPTION
The atan function returns the arc tangent of its argument. The return value is expressed in radians in the range [
, +
]. This function is antisymmetric.
such that for all x
The tan function performs the inverse operation
.
EXCEPTIONS
When x is finite and nonzero, the result of
might raise one of the following exceptions:
- inexact (for all nonzero values of x)
- underflow (if the result is inexact and must be represented as a denormalized number or 0)
SPECIAL CASES
Table 10-25 shows the results when the argument to the atan function is a zero, a NaN, or an Infinity.
Special cases for the atan function
Operation | Result | Exceptions raised |
|
| +0 | None |
|
|
| None |
|
| NaN | None[46] |
|
| +
| Inexact |
|
| -
| Inexact |
EXAMPLES
z = atan(1.0); /* z = arctan 1 = �/4 */
z = atan(-1.0); /* z = arctan -1 = -�/4. The inexact exception
is raised. */
[46] If the NaN is a signaling NaN, the invalid exception is raised.