C Programming/math.h/acos

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The acos() function (which stands for arc cosine) is defined in math.h. It accepts a variable, returns the arc cosine value of the variable. This function expects the values in the range of -1 to 1 and values are returned in the range 0 to PI (3.1415927). It prints NAN if a value greater than 1 is passed.

Syntax[edit | edit source]

float acos(float x);

Parameters[edit | edit source]

Floating point value whose arc cosine value has to be returned.

Returns[edit | edit source]

Floating point value (arc cosine value of variable).

References[edit | edit source]

  • The C Programming Language, Second Edition, By Brian W. Kernighan and Dennis M. Ritchie, Page no. 251
  • Programming With C, Second Edition, By Gottfried, Page no 487

External Links[edit | edit source]