约 1163 字

约 6 分钟

#C 语言标准库函数 nextdownf

#include <math.h>

float nextdownf(float x);

说明

求沿负无穷方向的下一个可表示值。

可在不自行估算浮点间隔的情况下确定邻点。间距随当前值的量级变化。

自 C23 起提供。

参数

  • x - 起始值。

返回值

  • 返回输入类型的相邻值。沿指定方向已到无穷时返回该无穷。

#示例

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

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

int main(void)
{
    printf("%d\n", nextdownf(1.0f) < 1);
    return 0;
}

#相关接口

#参考标准

更新: 2026/11/28

作者: planc

创建: 2026/11/28