Function to detect NaN values

Depending on your needs you can rely on the ieee_arithmetic module ieee_arithmetic in Fortran Wiki which already has a function for that, or you could have a read to this thread: Challenge: Testing Inf and NaN with `gfortran-13 -Ofast` for some ideas

2 Likes