Computes the sine.
#include <math.h>
double sin ( x)
double x;
float sinf (x) float x;
long double sinl (x) long double x;
The sin, sinf, sinl subroutines compute the sine of the x parameter, measured in radians.
An application wishing to check for error situations should set the errno global variable 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 | Floating-point value |
y | Floating-point value |
Upon successful completion, the sin, sinf, and sinl subroutines return the sine of x.
If x is NaN, a NaN is returned.
If x is ±0, x is returned.
If x is subnormal, a range error may occur and x should be returned.
If x is ±Inf, a domain error occurs, and a NaN is returned.
The sin, sinf, and sinl 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 subroutine during argument reduction of large arguments.
These error-handling procedures may be changed with the matherr subroutine when using the libmsaa.a (-lmsaa) library.
The matherr subroutine, sinh, sinhl (sinh, sinhf, or sinhl Subroutine) subroutines.
Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
128-Bit long double Floating-Point Format in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
math.h in AIX 5L Version 5.2 Files Reference.