#C 语言标准库函数 llquantexpd32
#include <math.h>
long long int llquantexpd32(_Decimal32 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 = llquantexpd32(1.20df);
printf("%lld\n", computed);
return !(computed == -2);
}
运行结果。
-2
#相关接口
- 接口变体 llquantexpd64、llquantexpd128
- 类型通用分派 llquantexp(类型通用宏)
- 相关操作 quantized32、quantumd32、samequantumd32