compute the arcsine
#include <math.h> double asin( double x );
The asin() function computes the principal value of the arcsine of x. A domain error occurs for arguments not in the range [-1,1].
The arcsine in the range [-PI/2, PI/2].
When the argument is outside the permissible range, the matherr() function is called. Unless the default matherr() function is replaced, it will set the global variable errno to EDOM, and print a "DOMAIN error" diagnostic message using the stderr stream.
#include <stdio.h> #include <math.h> void main() { printf( "%f\n", asin(.5) ); }
produces the output:
0.523599
ANSI
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
acos(), atan(), atan2(), errno, matherr()