Unless you compile with fast-math ofc, because then the compiler will assume that NaN never occurs in the program.