C Tutorial/math.h/acos

Материал из C\C++ эксперт
Перейти к: навигация, поиск

acos

Item Value Header file math.h Declaration float acosf(float arg);double acos(double arg);long double acosl(long double arg); Return The acos() returns the arc cosine of arg. Parameter The argument must be in the range -1 to 1.


#include <math.h>
  #include <stdio.h>
  int main(void)
  {
    double val = -1.0;
    do {
      printf("Arc cosine of %f is %f.\n", val, acos(val));
      val += 0.1;
    } while(val<=1.0);
    return 0;
  }