当前位置: C语言 -- 标准库 -- <float.h> -- DEC128_TRUE_MIN

DEC128_TRUE_MIN宏


概要:
#include <float.h>
#define DEC128_TRUE_MIN 0.000000000000000000000000000000001E-6143DL①

①小数点后存在32个连续0。


描述:

如果实现支持十进制浮点类型(即实现定义了宏__STDC_IEC_60559_DFP__。),宏DEC128_TRUE_MIN才会被定义。

该宏表示_Decimal128类型的最小正次规格化十进制浮点数。


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
/*宏DEC128_TRUE_MIN范例*/

#include <float.h>
#include <stdio.h>

int main(void)
{
    #ifdef __STDC_IEC_60559_DFP__
        #ifdef DEC128_TRUE_MIN
            printf("DEC128_TRUE_MIN = %.34DDE\n", DEC128_TRUE_MIN);
        #else
            puts("The implementation does not define macro DEC128_TRUE_MIN.");
        #endif
    #else
        puts("The implementation does not support decimal floating types.");
    #endif

    return 0;
}


输出:

The implementation does not support decimal floating types.

(注:编译时实现还未支持十进制浮点类型。)


相关内容:
LDBL_TRUE_MIN 表示long double类型的最小正浮点数的宏。
DEC32_TRUE_MIN 表示_Decimal32类型的最小正次规格化十进制浮点数的宏。
DEC64_TRUE_MIN 表示_Decimal64类型的最小正次规格化十进制浮点数的宏。


主要参考资料:

1、ISO/IEC 9899:2024