Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 |
both |
#define _XOPEN_SOURCE_EXTENDED 1
#include <math.h>
double nextafter(double x, double y);
#define _ISOC99_SOURCE
#include <math.h>
float nextafterf(float x, float y);
long double nextafterl(long double x, long double y);
#define _TR1_C99
#include <math.h>
float nextafter(float x, float y);
long double nextafter(long double x, long double y);
Function | Hex | IEEE |
---|---|---|
nextafter | X | X |
nextafterf | X | X |
nextafterl | X | X |
The nextafter() functions return the next representable value following x in the direction of y. They always succeed.
If x is finite and the correct function value overflows, a range error occurs and ±HUGE_VAL, ±HUGE_VALF, and ±HUGE_VALL (with the same sign as x) are returned as appropriate for the return type of the function.