---
title: asind
description: "计算输入实数的反正弦值对应的角度。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/kunpengaccel_kml_0147.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/kunpengaccel_kml_0147.html
indexId: 4f6ace746449955806b4e40b77e1d09a41cab05b4eaaed5651c1c19643e4d9a867
---
# asind

计算输入实数的反正弦值对应的角度。

#### 接口定义

C interface：

float asindf(float x);

double asind(double x);

double asind_18(double x);

long double asindl(long double x);

asind_18仅在高精度版本提供。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| x | 在asindf中，x是单精度浮点类型。 在asind和asind\_18中，x是双精度浮点类型。 在asindl中，x是长双精度浮点类型。 | 表示输入数据的浮点值。 | 输入 |


#### 返回值

返回输入x的反正弦函数值对应的角度y=asin(x) * 180 / π，y ∈ [-90, +90]。

- 输入+0，返回+0。
- 输入-0，返回-0。
- 输入x为±1，返回±90。
- 输入|x| > 1，返回nan。
- 输入±∞，返回nan。
- 输入nan，返回nan。


#### 依赖

C: "km.h"


#### 示例

C interface：

```
// typical usage
    float x1 = -1.0, x2 = 1.0, x3 = 0.5, x4 = -0.5;
    float a = 0.0, b = INFINITY, c = -INFINITY, d = NAN;
    // print result
    printf("asindf(1.0) = %.15f\n", asindf(x1));
    printf("asindf(-1.0) = %.15f\n", asindf(x2));
    printf("asindf(0.5) = %.15f\n", asindf(x3));
    printf("asindf(-0.5) = %.15f\n", asindf(x4));
    printf("asindf(0.0) = %.15f\n", asindf(a));
    printf("asindf(-0.0) = %.15f\n", asindf(-a));
    printf("asindf(INFINITY) = %.15f\n", asindf(b));
    printf("asindf(-INFINITY) = %.15f\n", asindf(c));
    printf("asindf(NAN) = %.15f\n", asindf(d));
    /* 
     * asindf(1.0) = -90.000000000000000
     * asindf(-1.0) = 90.000000000000000
     * asindf(0.5) = 30.000000000000000
     * asindf(-0.5) = -30.000000000000000
     * asindf(0.0) = 0.000000000000000
     * asindf(-0.0) = -0.000000000000000
     * asindf(INFINITY) = nan
     * asindf(-INFINITY) = nan
     * asindf(NAN) = nan
     * 
     * */
```
