asin
You can use the asin function to compute the arc sine of a real number between -1 and 1.
double_t asin (double_t x);
x
- Any floating-point number in the range -1
x
1.
DESCRIPTION
The asin function returns the arc sine of its argument. The return value is expressed in radians in the range [
, +
]. This function is antisymmetric.
such that for -1
x
1
The sin 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)
- invalid (if |x| > 1)
- underflow (if the result is inexact and must be represented as a denormalized number or 0)
SPECIAL CASES
Table 10-24 shows the results when the argument to the asin function is a zero, a NaN, or an Infinity, plus other special cases for the asin function.
Special cases for the asin function
Operation | Result | Exceptions raised |
|
for |x| > 1 | NaN | Invalid |
|
| -�/2 | Inexact |
|
| �/2 | Inexact |
|
| +0 | None |
|
|
| None |
|
| NaN | None[45] |
|
| NaN | Invalid |
|
| NaN | Invalid |
EXAMPLES
z = asin(1.0); /* z = arcsin 1 = �/2. The inexact exception is
raised. */
z = asin(-1.0); /* z = arcsin -1 = -�/2. The inexact exception
is raised. */
[45] If the NaN is a signaling NaN, the invalid exception is raised.