Computes the trigonometric functions.
or System V Math Library (libmsaa.a)
#include <math.h>
double sin (x) double x;
long double sinl (x) long double x;
double cos (x) double x;
long double cosl (x) long double x;
double tan (x) double x;
long double tanl (x) long double x;
The sin, cos, and tan subroutines return the sine, cosine, and tangent, respectively, of their parameters, which are in radians. The sinl subroutine, cosl subroutine, and tanl subroutine return the same values, but these subroutines take and return numbers of the long double data type.
The sin, sinl, cos, cosl, tan, and tanl subroutines lose accuracy when passed a large value for the x parameter. In the sin subroutine, for example, values of x that are greater than pi are argument-reduced by first dividing them by the machine value for 2 * pi , and then using the IEEE remainder of this division in place of x. Since the machine value of pi can only approximate its infinitely precise value, the remainder of x/(2 * pi) becomes less accurate as x becomes larger. Similar loss of accuracy occurs for the sinl, cos, cosl, tan, and tanl subroutines during argument reduction of large arguments.
These error-handling procedures may be changed with the matherr subroutine when using the libmsaa.a (-lmsaa) library.
These subroutines are part of Base Operating System (BOS) Runtime.
The matherr subroutine, sinh, sinhl, cosh, coshl, tanh, or tanhl subroutines.
Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.
128-Bit long double Floating-Point Format in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.