https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121570
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- As gfortran uses the C standard library IEEE interfacing, if that interface agrees with the Fortran language requirement we can rely on a correct implementation of the C standard library. Having a testcase in the testsuite pointing out wrong behavior therein would be a good thing to have, of course. The manpage on nextafter says The following errors can occur: Range error: result overflow errno is set to ERANGE. An overflow floating-point exception (FE_OVERFLOW) is raised. Range error: result is subnormal or underflows errno is set to ERANGE. An underflow floating-point exception (FE_UNDERFLOW) is raised. otherwise set exception flags should be unchanged by a call to nextafter().