Originally posted by leo donahue:
If we compare with the inequality operator: != The comparison is true.
"By definition" is the only option.
If floating point division by zero is really not the same as whatever the value of java.lang.Double.NaN is, then what is the value of floating point division by zero? Did someone just choose to use the same "word"(NaN) to describe that value?
It depends on what the numerator is.
If the numerator and denominator are both 0, the result is NaN.
If the numerator is, for instance, 1.0, then 1.0/0 is Infinity.
As Tim pointed out, in the case of 0.0/0 != Double.NaN, just because two things are not numbers, they are not necessarily equal to each other.
[ October 16, 2006: Message edited by: Keith Lynn ]