我要评分
获取效率
正确性
完整性
易理解

asin

Compute the arc sine value of a real number.

Interface Definition

C interface:

float asinf(float x);

double asin(double x);

Fortran interface:

RES = ASINF(X);

RES = ASIN(X);

Parameters

Parameter

Type

Description

Input/Output

x

  • For asinf, x is of single-precision floating-point type.
  • For asin, x is of double-precision floating-point type.

Floating-point value of a radian angle

Input

Return Value

  • Return the arc sine function value y of the radian angle x. x ∈ [-1, +1].
  • If the input is +0, the return value is +0.
  • If the input is -0, the return value is -0.
  • If the input x is ±1, the return value is ±π/2.
  • If the input |x| is greater than +1, the return value is NaN.
  • If the input is ±∞, the return value is NaN.
  • If the input is NaN, the return value is NaN.

Dependencies

C: "km.h"

Fortran: "km.f03"

Examples

C interface:

    double pi = acos(-1); 
    // typical usage 
    double a = pi/6, b = 1.0, c = -3*pi/4, d = pi/3; 
    // special handling 
    double e = INFINITY, f = -INFINITY, g = NAN; 
    // print result 
    printf("asin(pi/6) = %.15f\n", asin(a)); 
    printf("asin(1.0) = %.15f\n", asin(b)); 
    printf("asin(-3*pi/4) = %.15f\n", asin(c)); 
    printf("asin(pi/3) = %.15f\n", asin(d)); 
    printf("asin(INFINITY) = %.15f\n", asin(e)); 
    printf("asin(-INFINITY) = %.15f\n", asin(f)); 
    printf("asin(NAN) = %.15f\n", asin(g)); 
    /* 
     *  asin(pi/6) = 0.551069583099446 
     *  asin(1.0) = 1.570796326794897 
     *  asin(-3*pi/4) = nan  
     *  asin(pi/3) = nan  
     *  asin(INFINITY) = nan 
     *  asin(-INFINITY) = nan 
     *  asin(NAN) = nan 
     * 
     * */

Fortran interface:

    REAL(8) :: X = 1.0 
    PRINT*,  ASIN(X) 
    ! 
    ! OUTPUT 
    !     1.570796326794897 
    !