Checking for NaN
is simple since C++11:
#include <numeric> bool isNaN = std::isnan(myNumber);
See the std::isnan
docs for reference.
You can also use the C99 function isnan
from <cmath>
:
#include <cmath> bool isNaN = isnan(myDouble);
Checking for NaN
is simple since C++11:
#include <numeric> bool isNaN = std::isnan(myNumber);
See the std::isnan
docs for reference.
You can also use the C99 function isnan
from <cmath>
:
#include <cmath> bool isNaN = isnan(myDouble);
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow