[Previous]
[Contents]
[Next]

acos()

compute the arccosine

Synopsis:

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

Description:

The acos() function computes the principal value of the arccosine of x. A domain error occurs for arguments not in the range [-1,1].

Returns:

The arccosine in the range [0, PI].

When the argument is outside the permissible range, the matherr() function is called. Unless the default matherr() function is replaced, it will set the global variable errno to EDOM, and print a "DOMAIN error" diagnostic message using the stderr stream.

Examples:

#include <stdio.h>
#include <math.h>

void main()
  {
    printf( "%f\n", acos(.5) );
  }

produces the output:

1.047197

Classification:

ANSI

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

asin(), atan(), atan2(), matherr()


[Previous]
[Contents]
[Next]