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

Technical Reference: Base Operating System and Extensions, Volume 1

cosf, cosl, or cos Subroutine

Purpose

Computes the cosine.

Syntax

#include <math.h>

float cosf (x)
float x;

long double cosl (x)
long double x;

double cos (x)
double x;

Description

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.

Parameters

x Specifies the value to be computed.

Return Values

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.

Related Information

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.

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