acos (Windows CE 5.0)
Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference
Calculates the arccosine.
double acos( doublex);
Parameters
- x
Value between –1 and 1 whose arccosine is to be calculated.
Return Values
The acos function returns the arccosine of x in the range 0 to π radians.
If x is less than –1 or greater than 1, acos returns an indefinite (same as a quiet NaN).
Example
/* ASINCOS.C: This program prompts for a value in the range
* -1 to 1. Input values outside this range will produce
* _DOMAIN error messages.If a valid value is entered, the
* program prints the arcsine and the arccosine of that value.
*/
#include <stdlib.h>
void main( void )
{
double x, y;
printf( "Enter a real number between -1 and 1: " );
scanf( "%lf", &x );
y = asin( x );
printf( "Arcsine of %f = %f\n", x, y );
y = acos( x );
printf( "Arccosine of %f = %f\n", x, y );
}
Output
Enter a real number between -1 and 1: .32696
Arcsine of 0.326960 = 0.333085
Arccosine of 0.326960 = 1.237711
Requirements
OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.
See Also
Send Feedback on this topic to the authors