nextafter(3) Library Functions Manual nextafter(3) nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl - (libm -lm) #include 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); glibc ( feature_test_macros(7)): nextafter(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500 || /* glibc 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE nextafterf(), nextafterl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE nexttoward(), nexttowardf(), nexttowardl(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L nextafter() nextafterf() nextafterl() x y. y x x. x y y. nexttoward() nexttowardf() nexttowardl() nextafter() long double. x y. x y y ( x). x y NaN NaN. x HUGE_VAL HUGE_VALF HUGE_VALL . x y ( ) 0.0. math_error(7) . : : errno ERANGE. (FE_OVERFLOW). : errno ERANGE. (FE_UNDERFLOW). attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |nextafter()| | MT-Safe | |nextafterf()| | | |nextafterl()| | | |nexttoward()| | | |nexttowardf()| | | |nexttowardl()| | | +------------+------------------------------------+--------------------+ C11, POSIX.1-2008. IEC 559 ( IEEE 754/IEEE 854). C99 POSIX.1-2001. glibc 2.5 (FE_UNDERFLOW) . glibc 2.23 errno. nearbyint(3) 3 . . : . 6.18 8 2026 nextafter(3)