Table of Content

Acos / Acosl Function >> Math.h >> Header File in C



Acos / Acosl :

  1. The acos() function returns the arc cosine of argument
  2. Argument should be between -1 and 1.
  3. Acos return the arc cosine of the input value [ in the range 0 to PI ]
  4. On error ( if the arguments are not in the range -1 to 1) It returns NAN Or Displays “Invalid domain error

Syntax :

double acos( double arg );
long double acosl(long double (x));

Live Example :

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

int main(void)
{
double result;
double x = 0.5;

result = acos(x);
printf("Arc cosine of %lf : %lfn",x,result);
return 0;
}

Output :

Arc cosine of 0.500000 : 1.047198