I am going to do some math calculations using C++ .
The input floating point number is a valid number, but after calculations , the resulting value becomes NaN.
I would like to trace the point where NaN value appears (possibly using gdb), instead of inserting a lot of isNan() into the code.
But, I found that even code like this will not trigger any exceptions when NaN value appears.
double dirty = 0.0;
double nanvalue = 0.0/dirty;
Could anyone suggest some methods for tracing the NaN or turning Nan to exceptions?
Thank you very much :)