My understanding is that NaN (Not a Number) is essentaly a constant that is returned from a mathematical function to indicate something went wrong or the calculation is invalid. So it makes sense that their are functions to check if a number is NaN or better yet, use the CERT Coding Standard to do error checking for mathematical errors ( https://www.securecoding.cert.org/confluence/display/c/FLP32-C.+Prevent+or+detect+domain+and+range+errors+in+math+functions ).
My question is this; why does std::nan() exist? Why would you ever want to take a valid number/string/value and convert it to NaN? (Refrence: http://en.cppreference.com/w/cpp/numeric/math/nan )