I have an application in which a code area produces NAN values. I have to compare the values for equality and based on that execute the rest of the code.How to compare two N
Any given NaN is not equal to anything, it will never be equal to any other NaN, so comparing them against each other is a futile exercise.
From GNU docs:
NaN is unordered: it is not equal to, greater than, or less than anything, including itself. x == x is false if the value of x is NaN. source
x == x