Name

acos, acosf, acosl
- arc cosine function

Library

libm.lib

Synopsis

  #include <math.h>
  double acos (double x);
  float acosf (float x);
  long double acosl (long double x);

Return values

The acos, acosf, and acosl functions return the arc cosine in the range [0, pi] radians. If:
         
| x | > 1,

         

acos (x);
returns an NaN.

Detailed description

The acos, acosf, and acosl functions compute the principal value of the arc cosine of x.


Examples

#include <math.h>
int main( )
{
   double x = -1;
   double y = acos( x );
   printf( "acos(%f) = %f\n", x, y );
   y = acosf( x );
   printf( "acosf(%f) = %f\n", x, y );
   y = acosl( x );
   printf( "acosl(%f) = %f\n", x, y ); 
}

         

Output

acos( -1.000000 ) = 3.14159
acosf(-1.000000 ) = 3.14159
acosl(-1.000000 ) = 3.14159

         


See also

asin, atan, atan2, cos, cosh, math, sin, sinh, tan, tanh

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top