Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 10 - Transcendental Functions / Trigonometric Functions


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 [ -pi/2 , + pi/2 ]. This function is antisymmetric.

 such that  for all x 
The tan function performs the inverse operation (tan(y)) .

EXCEPTIONS
When x is finite and nonzero, the result of atan(x) 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
OperationResultExceptions raised
atan(+0) +0None
atan(-0) -0 None
atan(NaN) NaNNone[46]
atan(+ ) + pi/2 Inexact
atan(- ) - pi/2 Inexact

EXAMPLES
z = atan(1.0);    /* z = arctan 1 = \x86/4 */
z = atan(-1.0);   /* z = arctan -1 = -\x86/4. The inexact exception 
                     is raised. */

[46] If the NaN is a signaling NaN, the invalid exception is raised.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996