Keil™, An ARM® Company

CARM User's Guide

Discontinued

acos

Summary
#include <math.h>

double acos (
  double x);   /* number to calculate arc cosine of */
Description

The acos function calculates the arc cosine of the floating-point number x whose value must be between -1 and 1. The floating-point value returned by acos is a number in the range 0-π.

Return Value

The acos function returns the arc cosine of x.

See Also

asin, atan, atan2

Example
#include <math.h>
#include <stdio.h> /* for printf */

void tst_acos (void) {
  float x;
  float y;

  for (x = -1.0; x <= 1.0; x += 0.1) {
    y = acos (x);
    printf ("ACOS(%f) = %f\n", x, y);
  }
}