Flush-to-zero in gfortran
问题 Is there a way to force flush-to-zero of underflows in gfortran? I can't believe this is the first time someone has asked this, but I couldn't find anything on it anywhere. Mea culpa if this is a duplicate. 回答1: You can accomplish this with recent versions of gfortran that support the Fortran 2003 IEEE modules. The standard defines two underflow modes -- gradual and abrupt. Abrupt is the one you want which sets underflow to 0 and signals the underflow floating point exception. You can test