I remember having a 'WTF' moment with this code. The only value of x (a double) for which "x != x" is true is Double.NaN. This is, I can only suppose, a faster way to check Double.isNaN(). I don't know if it's faster, or if that's the intent. It's weird enough I wouldn't mind replacing with a proper check. If that's the intent.
On Sat, Jan 9, 2010 at 7:57 PM, Benson Margulies <[email protected]> wrote: > It gets some rather interesting warnings in Eclipse: > > These comparisons, for example ... > > if ((diff != diff) && ((value != value && x != x) || value == x)) { > diff = 0; > } >
