Home C&C++函数库 c++ 语法 程序源码 Linux C库

asin

函数  <cmath> <ctgmath>

C90 double asin(double x);
C99 double asin (double x);
float asinf (float x);
long double asinl (long double x);
C++98 double asin (double x);
float asin (float x);
long double asin (long double x);
C++11 double asin (double x);
float asin (float x);
long double asin (long double x);
double asin (T x);    // additional overloads for integral types

计算反正弦
返回反正弦(x)的主值,以弧度表示。
在三角函数中,反正弦是正弦的逆运算。

C99 头文件<tgmath.h> 提供了该函数的类型泛型宏版本。
C++98 这个函数在<valarray> 中重载(参见valarray asin)。
C++11 这个头文件(<cmath>) 为整型提供了额外的重载:这些重载在计算之前将x转换为double (在T是任何整型时定义)。
这个函数在<complex>和<valarray> 中也重载(参见complex asin和valarray asin)。

☲  参数


x
反正弦计算的值,在区间[-1,+1]内。
如果参数超出了这个间隔,就会发生域错误。

☉  返回值



x的反正弦主值,在[-pi /2,+pi /2]弧度范围内。
一弧度(radian)等于180/PI degrees。
C90(C++98) 如果发生域错误,则将全局变量errno设置为EDOM。
C99(C++11) 如果出现域错误:
-并且math_errhandling设置了MATH_ERRNO: 全局变量errno设置为EDOM。
-并且math_errhandling设置了MATH_ERREXCEPT: 触发FE_INVALID

☣  示例



/* asin example */
#include <stdio.h>      /* printf */
#include <math.h>       /* asin */

#define PI 3.14159265

int main ()
{
  double param, result;
  param = 0.5;
  result = asin (param) * 180.0 / PI;
  printf ("The arc sine of %f is %f degrees\n", param, result);
  return 0;
}

输出:
The arc sine of 0.500000 is 30.000000 degrees

🍄  另请参阅



acos 反余弦(function )
sin 正弦(function )


联系我们 免责声明 关于CandCplus 网站地图