Copyright © 1997 The Open Group

nextafter - next representable double-precision floating-point number

`#include <math.h> double nextafter(double`

x, doubley);

Thenextafter()function computes the next representable double-precision floating-point value followingxin the direction ofy. Thus, ifyis less thanx,nextafter()returns the largest representable floating-point number less thanx.An application wishing to check for error situations should set

errnoto 0 before callingnextafter(). Iferrnois non-zero on return, or the value NaN is returned, an error has occurred.

Thenextafter()function returns the next representable double-precision floating-point value followingxin the direction ofy.If

xoryis NaN, thennextafter()returns NaN and may seterrnoto [EDOM].If

xis finite and the correct function value would overflow, HUGE_VAL is returned anderrnois set to [ERANGE].

Thenextafter()function will fail if:

- [ERANGE]
- The correct value would overflow.
The

nextafter()function may fail if:

- [EDOM]
- The
xoryargument is NaN.

None.

None.

None.

<math.h>.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]