Hey everyone,
I'm converting some C code that does horrible things to doubles. At some point I have a check that does
Now looking at limits.h I see the std::numeric_limits functions. My question is now. Is it legal to do:Code:if (isnan(dblval) || isinf(dblval) { /* blah */}
since it compares two doubles directly, and what would be the a similar check for NaN?Code:if (std::numeric_limits<double>::infinity() == dblvalue) { /* blah */}
QuantumPete