约 1175 字

约 6 分钟

#C 语言标准库函数 llquantexpd64

#include <math.h>

long long int llquantexpd64(_Decimal64 x);

说明

提取十进制量子的指数。指数对应存储系数最低一位的十进制位权。

自 C23 起提供。需要实现定义 __STDC_IEC_60559_DFP__ 并提供对应的十进制浮点接口。

参数

  • x - 参与运算的实浮点值。

返回值

  • 返回量子指数,示例为 -2。遇到无穷或 NaN 时引发无效浮点异常,报告定义域错误并返回 LLONG_MIN。

#示例

使用 GCC 时,在链接命令末尾添加 -lm。

#include <math.h>
#include <stdio.h>

int main(void)
{
    long long int computed = llquantexpd64(1.20dd);
    printf("%lld\n", computed);
    return !(computed == -2);
}

运行结果。

-2

#相关接口

#参考标准

更新: 2026/11/28

作者: planc

创建: 2026/11/28