Calculates the trigonometric arc sine function of a single precision floating-point value.
Include
<math.h>
Prototype
float asinf (float x);
Argument
x
Return Value
Returns the arc sine in radians in the range of -pi/2 to +pi/2 (inclusive).
Remarks
A domain error occurs if x is less than -1 or greater than 1.
Example
#include <math.h>
#include <stdio.h>
#include <errno.h>
int main(void)
{
float x, y;
errno = 0;
x = 2.0F;
y = asinf(x);
if (errno)
perror("Error");
printf("The arcsine of %f is %f\n", x, y);
errno = 0;
x = 0.0F;
y = asinf(x);
if (errno)
perror("Error");
printf("The arcsine of %f is %f\n", x, y);
}
Example Output
Error: domain error
The arcsine of 2.000000 is nan
The arcsine of 0.000000 is 0.000000