acos

Computes the principal value of the arc cosine of the specified argument

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Mathematical Computation

Syntax

  #include <math.h>  
   
  double  acos  ( 
     double   x);
  

Parameters

x
(IN) Specifies an argument to compute the arc cosine for.

Return Values

The acos function returns the arc cosine in the range (0,p). When the argument is outside the permissible range, errno is set and matherr is called.

Remarks

A domain error occurs for arguments not in the range (-1,1).

See Also

asin, atan, atan2, matherr

Example

  #include <math.h>  
  #include <stdio.h>  
   
  main ()  
  {  
     printf ("%f\n", acos (.5) );  
  }
  

produces the following:

  1.047197