Copyright © 1997 The Open Group

acos - arc cosine function

`#include <math.h> double acos(double`

x);

Theacos()function computes the principal value of the arc cosine ofx.The value ofxshould be in the range [-1,1].An application wishing to check for error situations should set

errnoto 0 before callingacos(). Iferrnois non-zero on return, or the value NaN is returned, an error has occurred.

Upon successful completion,acos()returns the arc cosine ofx,in the range [0,_{}] radians. If the value ofxis not in the range [-1,1], and is not ±Inf or NaN, either 0.0 or NaN is returned anderrnois set to [EDOM].If

xis NaN, NaN is returned anderrnomay be set to [EDOM]. Ifxis ±Inf, either 0.0 is returned anderrnois set to [EDOM], or NaN is returned anderrnomay be set to [EDOM].

Theacos()function will fail if:

- [EDOM]
- The value
xis not ±Inf or NaN and is not in the range [-1,1].The

acos()function may fail if:

- [EDOM]
- The value
xis ±Inf or NaN.No other errors will occur.

None.

None.

None.

cos(),isnan(),<math.h>.

Derived from Issue 1 of the SVID.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]