Hi, I faced problem that std::isnan return false for NAN. I added this debug printf to my project:
printf("res %.2f %s %s\n", res,
std::isnan(res) ? "isnan" : "notnan",
std::isinf(res) ? "isinf" : "notinf");
and when res is NAN, output is following:
res nan notnan notinf
I tried to make a simple test case, but in test case it works fine. So, I think this is a sort of UB, but I run project with valgrind - no errors. I tried -s ASSERTIONS=1 -s SAFE_HEAP=2, also no errors.
Any suggestions what it can be?