Computes the cosine.
#include <math.h> float cosf (x) float x; long double cosl (x) long double x; double cos (x) double x;
The cosf, cosl, and cos subroutines compute the cosine of the x, parameter (measured in radians).
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these subroutines. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.
x | Specifies the value to be computed. |
Upon successful completion, the cosf, cosl, and cos subroutines return the cosine of x.
If x is NaN, a NaN is returned.
If x is ±0, the value 1.0 is returned.
If x is ±Inf, a domain error occurs, and a NaN is returned.
feclearexcept Subroutine, fetestexcept Subroutine, and class, _class, finite, isnan, or unordered Subroutines.
sin, sinl, cos, cosl, tan, or tanl Subroutine in AIX 5L Version 5.2 Technical Reference: Base Operating System and Extensions Volume 2.
math.h in AIX 5L Version 5.2 Files Reference.