C Math acos() Function
Example
Return the arccosine of different numbers:
printf("%f", acos(0.64));
printf("%f", acos(-0.4));
printf("%f", acos(0));
Try it Yourself »
Definition and Usage
The acos()
function returns the arccosine of a number in radians.
The acos()
function is defined in the <math.h>
header file.
Syntax
One of the following:
acos(double number);
Parameter Values
Parameter | Description |
---|---|
number | Required. A number to find the arccosine of, in the range -1 to 1. If the value is outside -1 to 1, it returns NaN (Not a Number). |
Technical Details
Returns: |
A double value representing the arccosine of a number in radians.
|
---|