[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

acos, acosf, or acosl Subroutine

Purpose

Computes the inverse cosine of a given value.

Syntax

#include <math.h>

float acosf (x) 
float x;

long double acosl (x) 
long double x;

double acos (x)
double x;

Description

The acosf, acosl, and acos subroutines compute the principal value of the arc cosine of the x parameter. The value of x should be in the range [-1,1].

An application wishing to check for error situations should set the errno global variable to zero and call fetestexcept(FE_ALL_EXCEPT) before calling these functions. On return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.

Parameters

x Specifies the value to be computed.

Return Values

Upon successful completion, these subroutines return the arc cosine of x, in the range [0, pi] radians.

For finite values of x not in the range [-1,1], a domain error occurs, and a NaN is returned.

If x is NaN, a NaN is returned.

If x is +1, 0 is returned.

If x is ±Inf, a domain error occurs, and a NaN is returned.

Related Information

The acosh, acoshf, or acoshl Subroutine.

math.h in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]