Important: The information in this document is obsolete and should not be used for new development.
sin
You can use thesin
function to compute the sine of a real number.
double_t sin (double_t x);
x
- Any finite floating-point number.
DESCRIPTION
Thesin
function returns the sine of its argument. The argument is the measure of an angle expressed in radians. This function is antisymmetric with respect to the y-axis
(sin x sin -x).The
asin
function performs the inverse operation .EXCEPTIONS
When x is finite and nonzero, the result of might raise one of the following exceptions:
- inexact (for all finite, nonzero values of x)
- underflow (if the result is inexact and must be represented as a denormalized number or 0)
SPECIAL CASES
Table 10-21 shows the results when the argument to thesin
function is a zero, a NaN, or an Infinity, plus other special cases for thesin
function.
Special cases for the sin
functionOperation Result Exceptions raised 0 Inexact +0 None -0 None NaN None[42] NaN Invalid NaN Invalid EXAMPLES
z = sin(pi/2); /* z = 1. The inexact exception is raised. */ z = sin(pi); /* z = 0. The inexact exception is raised. */ z = sin(-pi/2); /* z = -1. The inexact exception is raised. */ z = sin(-pi); /* z = 0. The inexact exception is raised. */
[42] If the NaN is a signaling NaN, the invalid exception is raised.