This documentation is archived and is not being maintained.


Returns the next representable neighbor.

double _nextafter(
   double x,
   double y 


x, y

Double-precision floating-point values.

If x=y, _nextafter returns x, with no exception triggered. If either x or y is a quiet NaN, then the return value is one or the other of the input NaNs.

The _nextafter function returns the closest representable neighbor of x in the direction toward y.

Routine Required header Compatibility



Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For more compatibility information, see Compatibility in the Introduction.


All versions of the C run-time libraries.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.