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

FP_LLOGBNAN宏


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

描述:

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

如果宏FP_ILOGBNAN值为INT_MIN,宏FP_LLOGBNAN值为LONG_MIN;如果宏FP_ILOGBNAN值为INT_MAX,宏FP_LLOGBNAN值为LONG_MAX。


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

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

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

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

    return 0;
}


输出:

The implementation does not define macro FP_LLOGBNAN.


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


主要参考资料:

1、ISO/IEC 9899:2024