C++: proper init for double/float and the proper check

Written by  on May 9, 2019 

Problem was that I initialized some doubles with 0.0 and then hoped that the imported values are assigned, which does not happen always. So a check was needed. But checking if(0.0 == x) is a really bad idea. MinGW will tell you too (as other compilers).
So I was searching for a proper way to check against 0.0. And then I found a better idea: initialize with NaN and use the standard-check against this. Much better!

(addendum: I know, a variant would be the best to fix the given task.)

Category : C++compilermingw