# asinf Function

Calculates the trigonometric arc sine function of a single precision floating-point value.

Include

<math.h>

Prototype

float asinf(float x);

Argument

 x value between -1 and 1 for which to return the arc sine

Return Value

Returns the arc sine in radians in the range [-π/2, +π/2] radians (inclusive) or NaN if a domain error occurs.

Remarks

If x is less than -1 or greater than 1, a domain error will occur and errno will be set to EDOM.

Example

See the notes at the beginning of this chapter or section for information on using printf() or scanf() (and other functions reading and writing the stdin or stdout streams) in the example code.

#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