posted 23 years ago
This question really has nothing to do with NaN. It's about object equivalence.
Two different objects (like your Double objects) can NEVER be equivalent, ie, the same object, because they are different objects.
Object ob1 = new Object();
Object ob2 = new Object();
ob1 and ob2 are two different Objects, so this code will always evaluate to false:
ob1 == ob2.
This is the same situation you have with comparing your doubles. You have
'a' and 'b' are two different objects, so they can NEVER return true when you write
a == b.
[ April 17, 2002: Message edited by: Rob Ross ]