Guardian C Library Calls Reference Manual
acos
3-2 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
Usage Guidelines
•
The absolute value of the most negative integer (INT_MIN) cannot be represented.
Example
This example prints “The absolute value of -25 is 25.”
#include <stdioh>
#include <stdlibh>
int main(void)
{
int r, x;
x = -25;
r = abs(x);
printf("The absolute value of %d is %d.", x, r);
}
acos
The acos function computes the arc cosine of its argument.
expr
is an expression of type double whose value is in the range -1 to +1.
Return Value
is the arc cosine of expr, expressed as a double value in the range 0 to pi radians. If
expr is not in the interval -1 to +1, acos returns the value zero and sets errno to
EDOM (a domain error).
Example
This example prints “The arc cosine is 0.000000.”
#include <mathh>
#include <stdioh>
int main(void)
{
double r, x;
x = 1.0;
r = acos(x);
printf("The arc cosine is %f.", r);
}
#include <mathh>
double acos(double expr);