#C 语言标准库函数 nextup
#include <math.h>
double nextup(double x);
说明
求沿正无穷方向的下一个可表示值。
可在不自行估算浮点间隔的情况下确定邻点。间距随当前值的量级变化。
自 C23 起提供。
参数
x- 起始值。
返回值
- 返回输入类型的相邻值。沿指定方向已到无穷时返回该无穷。
#示例
使用 GCC 时,在链接命令末尾添加 -lm。
#include <math.h>
#include <stdio.h>
int main(void)
{
printf("%d\n", nextup(1.0) > 1);
return 0;
}
#相关接口
- 接口变体 nextupf、nextupl、nextupd32、nextupd64、nextupd128
- 类型通用分派 nextup(类型通用宏)
- 相关操作 nextafter、nextdown、nexttoward