| NEXTAFTER(3) | Library Functions Manual | NEXTAFTER(3) |
nextafter, nextafterf,
nextafterl, nexttoward,
nexttowardf, nexttowardl
—
#include <math.h>
double
nextafter(double
x, double y);
float
nextafterf(float
x, float y);
long double
nextafterl(long
double x, long double
y);
double
nexttoward(double
x, long double
y);
float
nexttowardf(float
x, long double
y);
long double
nexttowardl(long
double x, long double
y);
nextafter(), nextafterf(),
and nextafterl() functions return the next machine
representable number from x in direction of
y. In other words, if y is less
than x, the functions return the largest representable
floating-point number less than x. When
x equals y, the value of
y is returned. The three functions differ only in the
type of the return value and x.
The nexttoward() and
nexttowardf() functions are equivalent to the
nextafter() family of functions with two
exceptions:
nexttowardl() is equivalent to
nextafterl().
±HUGE_VAL,
±HUGE_VALF, or
±HUGE_VALL with the same sign as
x. When either x or
y is NaN, a NaN is returned. When
x is not y but the function value
is subnormal, zero, or underflows, a range error occurs, and either 0.0 or the
correct function value (if representable) is returned.
| September 13, 2015 | NetBSD 9.0 |