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

FP_LLOGB0宏


概要:
#include <math.h>
#define FP_LLOGB0 value	//value值由实现定义。

描述:

该宏会扩展为整型常量表达式,其值是函数llogb(0)的返回值。

如果宏FP_ILOGB0值为INT_MIN,宏FP_LLOGB0值为LONG_MIN;如果宏FP_ILOGB0值为-INT_MAX,宏FP_LLOGB0值为-LONG_MAX。


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

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

int main(void)
{
    #ifdef FP_LLOGB0
        if(FP_LLOGB0 == LONG_MIN)
            puts("FP_LLOGB0 == LONG_MIN");

        if(FP_LLOGB0 == -LONG_MAX)
            puts("FP_LLOGB0 == -LONG_MAX");
    #else
        puts("The implementation does not define macro FP_LLOGB0.");
    #endif

    return 0;
}


输出:

The implementation does not define macro FP_LLOGB0.


相关内容:
FP_LLOGBNAN 表示函数llogb(NaN)返回值的宏。


主要参考资料:

1、ISO/IEC 9899:2024