C Standard Library

C <math.h> - asin() Function



The C <math.h> asin() function returns arc sine of a value. The returned value will be in the range -𝜋/2 through 𝜋/2.

Note: asin() is the inverse of sin().

Syntax

double asin (double x);
float asinf (float x);
long double asinl (long double x);

Parameters

x Specify the value in range [-1, 1].

Return Value

Returns the arc sine of the value.
If the x is not in the range of [-1, 1], domain error occurs.

Example:

In the example below, asin() function is used to find out the arc sine of a given value.

#include <stdio.h>
#include <math.h>
 
int main (){
  printf("%lf\n",asin(0.25));
  printf("%lf\n",asin(0.5));
  printf("%lf\n",asin(1));
  return 0;
}

The output of the above code will be:

0.252680
0.523599
1.570796

❮ C <math.h> Library