Je compile le code suivant avec l'option -ffast-math
:Mingw32 std :: isnan avec -ffast-math
#include <limits>
#include <cmath>
#include <iostream>
int main() {
std::cout << std::isnan(std::numeric_limits<double>::quiet_NaN()) << std::endl;
}
Je reçois 0 en sortie. Comment mon code peut-il indiquer si un nombre à virgule flottante est NaN lorsqu'il est compilé avec -ffast-math
?
Remarque: Sur linux, std :: isnan fonctionne même avec -fast-math.