What is the purpose of the function ?
bool whatIsIt(double n)
{
return n == n;
}
It can be used to check every bit in n ?
I doubt that .
Any comments are appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It could be used to check if n is NaN (not a number), since NaN does not compare equal to itself.
Probably a finnicky and not entirely reliable way to do it. (see Billy’s various comments) C99 and C++11 have the
isnan()function.