Check out example codes for "C++ is nan". It will help you in understanding the concepts better.

Code Example 1

doubel a = 0 ;
bool isnan_a = std::isnan(a) || std::isnan(-a);

Learn ReactJs, React Native from akashmittal.com