
# Libm支持接口
Huawei LiteOS提供一套Libm开源接口，具体的规格参见下表。
![](https://support.huaweicloud.com/lib-LiteOS/public_sys-resources/notice_3.0-zh-cn.png)
Libm不支持设置错误返回码。
| 头文件    | 接口名          | 类型     | 说明                                                                                |
|:---|:---|:---|:---|
| math.h | acos         | 数学计算函数 | 取反余弦函数值                                                                           |
| math.h | acosf        | 数学计算函数 | 求反余弦函数                                                                            |
| math.h | acosh        | 数学计算函数 | 求反双曲余弦值                                                                           |
| math.h | acoshf       | 数学计算函数 | 求反双曲余弦值                                                                           |
| math.h | acoshl       | 数学计算函数 | 求反双曲余弦值                                                                           |
| math.h | acosl        | 数学计算函数 | 求反余弦函数                                                                            |
| math.h | asin         | 数学计算函数 | 取反正弦函数值                                                                           |
| math.h | asinf        | 数学计算函数 | 求反正弦函数                                                                            |
| math.h | asinh        | 数学计算函数 | 求反双曲正弦值                                                                           |
| math.h | asinhf       | 数学计算函数 | 求反双曲正弦值                                                                           |
| math.h | asinhl       | 数学计算函数 | 求反双曲正弦值                                                                           |
| math.h | asinl        | 数学计算函数 | 求反正弦函数                                                                            |
| math.h | atan         | 数学计算函数 | 取反正切函数值                                                                           |
| math.h | atan2        | 数学计算函数 | 取得反正切函数值                                                                          |
| math.h | atan2f       | 数学计算函数 | 求反正切的值(以弧度表示)                                                                     |
| math.h | atan2l       | 数学计算函数 | 求反正切的值(以弧度表示)                                                                     |
| math.h | atanf        | 数学计算函数 | 求反正切函数                                                                            |
| math.h | atanh        | 数学计算函数 | 求反双曲线正切函数                                                                         |
| math.h | atanhf       | 数学计算函数 | 求反双曲线正切函数                                                                         |
| math.h | atanhl       | 数学计算函数 | 求反双曲线正切函数                                                                         |
| math.h | atanl        | 数学计算函数 | 求反正切函数                                                                            |
| math.h | cbrtl        | 数学计算函数 | 求立方根函数                                                                            |
| math.h | ceill        | 数学计算函数 | 计算最小整数值                                                                           |
| math.h | copysignl    | 数学计算函数 | 返回x，但是符号位变为y的符号位                                                                  |
| math.h | coshl        | 数学计算函数 | 求双曲线余弦函数                                                                          |
| math.h | cosl         | 数学计算函数 | 求余弦函数                                                                             |
| math.h | drem         | 数学计算函数 | 求余数(double)                                                                       |
| math.h | dremf        | 数学计算函数 | 求余数(float)                                                                        |
| math.h | erf          | 数学计算函数 | 求误差函数                                                                             |
| math.h | erfc         | 数学计算函数 | 求误差补函数                                                                            |
| math.h | erfcf        | 数学计算函数 | 求误差补函数                                                                            |
| math.h | erfcl        | 数学计算函数 | 求误差补函数                                                                            |
| math.h | erff         | 数学计算函数 | 求误差函数                                                                             |
| math.h | erfl         | 数学计算函数 | 求误差函数                                                                             |
| math.h | exp          | 数学计算函数 | 计算指数                                                                              |
| math.h | exp10l       | 数学计算函数 | 计算以10为底的x次方值                                                                      |
| math.h | exp2         | 数学计算函数 | 计算以2为底的x次方值                                                                       |
| math.h | exp2f        | 数学计算函数 | 计算以2为底的x次方值                                                                       |
| math.h | exp2l        | 数学计算函数 | 计算以2为底的x次方值                                                                       |
| math.h | expf         | 数学计算函数 | 计算以e为底的x次方值                                                                       |
| math.h | expl         | 数学计算函数 | 计算以e为底的x次方值                                                                       |
| math.h | expm1        | 数学计算函数 | exp(x) - 1.0                                                                      |
| math.h | expm1f       | 数学计算函数 | exp(x) - 1                                                                        |
| math.h | expm1l       | 数学计算函数 | exp(x) - 1                                                                        |
| math.h | fabs         | 数学计算函数 | 计算浮点型数的绝对值                                                                        |
| math.h | fabsf        | 数学计算函数 | 求浮点数的绝对值                                                                          |
| math.h | fabsl        | 数学计算函数 | 求浮点数的绝对值                                                                          |
| math.h | fdim         | 数学计算函数 | 计算入参的差值的绝对值                                                                       |
| math.h | fdimf        | 数学计算函数 | 计算入参的差值的绝对值                                                                       |
| math.h | fdiml        | 数学计算函数 | 计算入参的差值的绝对值                                                                       |
| math.h | finite       | 数学计算函数 | 判断数据是否有效                                                                          |
| math.h | finitef      | 数学计算函数 | 判断数据是否有效                                                                          |
| math.h | floor        | 数学计算函数 | 向下取整                                                                              |
| math.h | floorf       | 数学计算函数 | 向下取整                                                                              |
| math.h | floorl       | 数学计算函数 | 向下取整                                                                              |
| math.h | fma          | 数学计算函数 | 浮点运算(x · y) + z                                                                   |
| math.h | fmaf         | 数学计算函数 | 浮点运算(x · y) + z                                                                   |
| math.h | fmal         | 数学计算函数 | 浮点运算(x · y) + z                                                                   |
| math.h | fmax         | 数学计算函数 | 返回两个浮点入参的较大值                                                                      |
| math.h | fmaxf        | 数学计算函数 | 返回两个浮点入参的较大值                                                                      |
| math.h | fmaxl        | 数学计算函数 | 返回两个浮点入参的较大值                                                                      |
| math.h | fmin         | 数学计算函数 | 返回两个浮点入参的较小值                                                                      |
| math.h | fminf        | 数学计算函数 | 返回两个浮点入参的较小值                                                                      |
| math.h | fminl        | 数学计算函数 | 返回两个浮点入参的较小值                                                                      |
| math.h | fmod         | 数学计算函数 | 计算余数                                                                              |
| math.h | fmodf        | 数学计算函数 | 计算余数                                                                              |
| math.h | fmodl        | 数学计算函数 | 计算余数                                                                              |
| math.h | frexp        | 数学计算函数 | 将浮点型数分为尾数与指数                                                                      |
| math.h | frexpf       | 数学计算函数 | 把浮点数分解成尾数和指数                                                                      |
| math.h | frexpl       | 数学计算函数 | 把浮点数分解成尾数和指数                                                                      |
| math.h | hypot        | 数学计算函数 | 返回直角三角形斜边长度                                                                       |
| math.h | hypotf       | 数学计算函数 | 返回直角三角形斜边长度                                                                       |
| math.h | hypotl       | 数学计算函数 | 返回直角三角形斜边长度                                                                       |
| math.h | ilogb        | 数学计算函数 | 与logb相同，但是返回有符号数的整数                                                               |
| math.h | ilogbf       | 数学计算函数 | 与logb相同，但是返回有符号数的整数                                                               |
| math.h | ilogbl       | 数学计算函数 | 与logb相同，但是返回有符号数的整数                                                               |
| math.h | isnan        | 数据判断   | 判断参数是否为不可表示的值                                                                     |
| math.h | j0           | 数学计算函数 | 返回x的一类0阶的Bessel函数                                                                 |
| math.h | j0f          | 数学计算函数 | 返回x的一类0阶的Bessel函数                                                                 |
| math.h | j1           | 数学计算函数 | 返回x的一类1阶的Bessel函数                                                                 |
| math.h | j1f          | 数学计算函数 | 返回x的一类1阶的Bessel函数                                                                 |
| math.h | jn           | 数学计算函数 | 返回x的一类n阶的Bessel函数                                                                 |
| math.h | jnf          | 数学计算函数 | 返回x的一类n阶的Bessel函数                                                                 |
| math.h | ldexp        | 数学计算函数 | 返回x乘以2的exp次幂                                                                      |
| math.h | ldexpf       | 数学计算函数 | 返回x乘以2的exp次幂                                                                      |
| math.h | ldexpl       | 数学计算函数 | 返回x乘以2的exp次幂                                                                      |
| math.h | lgamma       | 数学计算函数 | 返回gamma函数的绝对值的自然对数，gamma函数为：gamma (x) = integral from 0 to ∞ of t\^(x-1) e\^-t dt |
| math.h | lgamma_r     | 数学计算函数 | lgamma_r与lgamma类似，但它将中间结果的符号存储在第二个入参指向的变量中，而不是存储在全局变量中。这个接口是可重入的。                 |
| math.h | lgammaf      | 数学计算函数 | 返回gamma函数的绝对值的自然对数，gamma函数为：gamma (x) = integral from 0 to ∞ of t\^(x-1) e\^-t dt |
| math.h | lgammaf_r    | 数学计算函数 | lgamma_r与lgamma类似，但它将中间结果的符号存储在第二个入参指向的变量中，而不是存储在全局变量中。这个接口是可重入的。                 |
| math.h | lgammal      | 数学计算函数 | 返回gamma函数的绝对值的自然对数，gamma函数为：gamma (x) = integral from 0 to ∞ of t\^(x-1) e\^-t dt |
| math.h | lgammal_r    | 数学计算函数 | lgamma_r与lgamma类似，但它将中间结果的符号存储在第二个入参指向的变量中，而不是存储在全局变量中。这个接口是可重入的。                 |
| math.h | llrint       | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值                                                                |
| math.h | llrintf      | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值                                                                |
| math.h | llrintl      | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值                                                                |
| math.h | llround      | 数学计算函数 | 四舍五入为整数                                                                           |
| math.h | llroundf     | 数学计算函数 | 四舍五入为整数                                                                           |
| math.h | llroundl     | 数学计算函数 | 四舍五入为整数                                                                           |
| math.h | log          | 数学计算函数 | 计算以e为底的对数值                                                                        |
| math.h | log10        | 数学计算函数 | 计算以10为底的对数值                                                                       |
| math.h | log10f       | 数学计算函数 | 计算以10为底的x对数值                                                                      |
| math.h | log10l       | 数学计算函数 | 计算以10为底的x对数值                                                                      |
| math.h | log1p        | 数学计算函数 | log(1+x)                                                                          |
| math.h | log1pf       | 数学计算函数 | log(1+x)                                                                          |
| math.h | log1pl       | 数学计算函数 | log(1+x)                                                                          |
| math.h | log2         | 数学计算函数 | 计算以2为底的x对数值                                                                       |
| math.h | log2f        | 数学计算函数 | 计算以2为底的x对数值                                                                       |
| math.h | log2l        | 数学计算函数 | 计算以2为底的x对数值                                                                       |
| math.h | logb         | 数学计算函数 | 使用FLT_RADIX作为对数的底数，返回x绝对值的对数                                                      |
| math.h | logbf        | 数学计算函数 | 使用FLT_RADIX作为对数的底数，返回x绝对值的对数                                                      |
| math.h | logbl        | 数学计算函数 | 使用FLT_RADIX作为对数的底数，返回x绝对值的对数                                                      |
| math.h | logf         | 数学计算函数 | 计算以e为底的x对数值                                                                       |
| math.h | logl         | 数学计算函数 | 计算以e为底的x对数值                                                                       |
| math.h | lrint        | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值，返回值为long int型                                                  |
| math.h | lrintf       | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值，返回值为long int型                                                  |
| math.h | lrintl       | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值，返回值为long int型                                                  |
| math.h | lround       | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值，返回值为long int型                                                  |
| math.h | lroundf      | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值，返回值为long int型                                                  |
| math.h | lroundl      | 数学计算函数 | 根据当前的舍入方式，将x舍入为整数值，返回值为long int型                                                  |
| math.h | modf         | 数学计算函数 | 将浮点型数分解成整数与小数，返回小数部分                                                              |
| math.h | modff        | 数学计算函数 | 将一个浮点值分为整数和小数部分。                                                                  |
| math.h | modfl        | 数学计算函数 | 将一个浮点值分为整数和小数部分。                                                                  |
| math.h | nan          | 数据判断   | 返回非数                                                                              |
| math.h | nanf         | 数据判断   | 返回非数                                                                              |
| math.h | nanl         | 数据判断   | 返回非数                                                                              |
| math.h | nearbyint    | 数学计算函数 | 根据当前舍入模式，将x舍入为整数值                                                                 |
| math.h | nearbyintf   | 数学计算函数 | 根据当前舍入模式，将x舍入为整数值                                                                 |
| math.h | nearbyintl   | 数学计算函数 | 根据当前舍入模式，将x舍入为整数值                                                                 |
| math.h | nextafter    | 数学计算函数 | 取两个双精度浮点数之间与第一个数相邻的浮点数，两数相等，则返回第二个数。                                              |
| math.h | nextafterf   | 数学计算函数 | 取两个浮点数之间与第一个数相邻的浮点数，两数相等，则返回第二个数。                                                 |
| math.h | nextafterl   | 数学计算函数 | 返回x在y方向上的下一个可表示的数                                                                 |
| math.h | nexttoward   | 数学计算函数 | 返回x在y方向上的上一个可表示的数                                                                 |
| math.h | nexttowardf  | 数学计算函数 | 返回x在y方向上的上一个可表示的数                                                                 |
| math.h | nexttowardl  | 数学计算函数 | 返回x在y方向上的上一个可表示的数                                                                 |
| math.h | pow          | 数学计算函数 | 计算次方值                                                                             |
| math.h | pow10        | 数学计算函数 | 计算10的x次方                                                                          |
| math.h | pow10f       | 数学计算函数 | 计算10的x次方                                                                          |
| math.h | pow10l       | 数学计算函数 | 计算10的x次方                                                                          |
| math.h | powf         | 数学计算函数 | 求 x 的 y 次幂（次方）                                                                    |
| math.h | powl         | 数学计算函数 | 求 x 的 y 次幂（次方）                                                                    |
| math.h | remainder    | 数学计算函数 | 计算余数，舍入到最接近的整数                                                                    |
| math.h | remainderf   | 数学计算函数 | 计算余数，舍入到最接近的整数                                                                    |
| math.h | remainderl   | 数学计算函数 | 计算余数，舍入到最接近的整数                                                                    |
| math.h | remquo       | 数学计算函数 | 计算余数                                                                              |
| math.h | remquof      | 数学计算函数 | 计算余数                                                                              |
| math.h | remquol      | 数学计算函数 | 计算余数                                                                              |
| math.h | rint         | 数学计算函数 | 将浮点数舍入到最接近的整数                                                                     |
| math.h | rintf        | 数学计算函数 | 将浮点数舍入到最接近的整数                                                                     |
| math.h | rintl        | 数学计算函数 | 将浮点数舍入到最接近的整数                                                                     |
| math.h | round        | 数学计算函数 | 返回x的四舍五入整数值                                                                       |
| math.h | roundf       | 数学计算函数 | 返回x的四舍五入整数值                                                                       |
| math.h | roundl       | 数学计算函数 | 返回x的四舍五入整数值                                                                       |
| math.h | scalb        | 数学计算函数 | 返回x \* 2^exp^                                                                     |
| math.h | scalbf       | 数学计算函数 | 返回x \* 2^exp^                                                                     |
| math.h | scalbln      | 数学计算函数 | 返回x \* 2^exp^                                                                     |
| math.h | scalblnf     | 数学计算函数 | 返回x \* 2^exp^                                                                     |
| math.h | scalblnl     | 数学计算函数 | 返回x \* 2^exp^                                                                     |
| math.h | scalbn       | 数学计算函数 | 返回x乘以FLT_RADIX的n次幂                                                                |
| math.h | scalbnf      | 数学计算函数 | 返回x乘以FLT_RADIX的n次幂                                                                |
| math.h | scalbnl      | 数学计算函数 | 返回x乘以FLT_RADIX的n次幂                                                                |
| math.h | significand  | 数学计算函数 | 返回范围\[1,2)的尾数，scalb (x, (double) -ilogb (x)).                                     |
| math.h | significandf | 数学计算函数 | 返回范围\[1,2)的尾数，scalb (x, (double) -ilogb (x)).                                     |
| math.h | sin          | 数学计算函数 | 取正弦函数值                                                                            |
| math.h | sincosl      | 数学计算函数 | 取正弦余弦值                                                                            |
| math.h | sinf         | 数学计算函数 | 求正弦函数                                                                             |
| math.h | sinh         | 数学计算函数 | 取双曲线正弦函数值                                                                         |
| math.h | sinhf        | 数学计算函数 | 求双曲线正弦函数                                                                          |
| math.h | sinhl        | 数学计算函数 | 求双曲线正弦函数                                                                          |
| math.h | sinl         | 数学计算函数 | 求正弦函数                                                                             |
| math.h | sqrt         | 数学计算函数 | 计算平方根值                                                                            |
| math.h | sqrtf        | 数学计算函数 | 计算平方根值                                                                            |
| math.h | sqrtl        | 数学计算函数 | 计算平方根值                                                                            |
| math.h | tan          | 数学计算函数 | 求正切函数                                                                             |
| math.h | tanf         | 数学计算函数 | 求正切函数                                                                             |
| math.h | tanh         | 数学计算函数 | 取双曲线正切函数值                                                                         |
| math.h | tanhf        | 数学计算函数 | 求双曲线正切函数                                                                          |
| math.h | tanhl        | 数学计算函数 | 求双曲线正切函数                                                                          |
| math.h | tanl         | 数学计算函数 | 求正切函数                                                                             |
| math.h | tgamma       | 数学计算函数 | 参数为arg的gamma函数返回                                                                  |
| math.h | tgammaf      | 数学计算函数 | 参数为arg的gamma函数返回                                                                  |
| math.h | tgammal      | 数学计算函数 | 参数为arg的gamma函数返回                                                                  |
| math.h | trunc        | 时间函数   | 截取日期或数字，返回指定的值                                                                    |
| math.h | truncf       | 时间函数   | 截取日期或数字，返回指定的值                                                                    |
| math.h | truncl       | 时间函数   | 截取日期或数字，返回指定的值                                                                    |
| math.h | y0           | 数学计算函数 | 返回x的第二类0阶Bessel函数                                                                 |
| math.h | y0f          | 数学计算函数 | 返回x的第二类0阶Bessel函数                                                                 |
| math.h | y1           | 数学计算函数 | 返回x的第二类1阶Bessel函数                                                                 |
| math.h | y1f          | 数学计算函数 | 返回x的第二类1阶Bessel函数                                                                 |
| math.h | yn           | 数学计算函数 | 返回x的第二类n阶Bessel函数                                                                 |
| math.h | ynf          | 数学计算函数 | 返回x的第二类n阶Bessel函数                                                                 |
   
