nextafter(3M)
NAME
nextafter − next representable double-precision floating-point number
SYNOPSIS
cc [ flag ... ] file ... −lm [ library ... ]
#include <math.h>
double nextafter(double x, double y);
DESCRIPTION
The nextafter() function computes the next representable double-precision floating-point value following x in the direction of y. Thus, if y is less than x, nextafter() returns the largest representable floating-point number less than x.
RETURN VALUES
The nextafter() function returns the next representable double-precision floating-point value following x in the direction of y.
If x or y is NaN, then nextafter() returns NaN.
If x is finite and the correct function value would overflow, nextafter() returns ±HUGE_VAL (according to the sign of x) and sets errno to ERANGE.
ERRORS
The nextafter() function will fail if:
ERANGE The correct value would overflow.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| MT-Level | MT-Safe |
SEE ALSO
SunOS 5.6 — Last change: 29 Dec 1996