asin function calculates the arc sine

Syntax

asin function has the following declaration.

  • float asinf(float arg);
  • double asin(double arg);
  • long double asinl(long double arg);

asin function is from header file math.h.

Description

asin returns the arc sine.

The asin's parameter must be in the range -1 to 1; otherwise a domain error will occur.

Example

The following code calcualtes the arc sine with C asin function.


#include <math.h>
#include <stdio.h>
/*w  w w.  j  ava 2 s  . c o m*/
int main(void)
{
  double val = -1.0;

  do {
    printf("Arc sine of %f is %f.\n", val, asin(val));
    val += 0.1;
  } while(val<=1.0);

  return 0;
}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h