Subj : Re: Spidermonkey: Incorrect NaN comparison To : netscape.public.mozilla.jseng From : Robert Ginda Date : Fri May 16 2003 01:15 am See section 11.9.3, step 5, which states that NaN == NaN is always false. To test for NaN, use the builtin isNaN function, described in 15.1.2.4. Rob. Corey Murtagh wrote: > Trying this: > > print(Math.floor(undefined) + " " + > Math.floor(undefined) == NaN) > > produces: > > NaN false > > So, it appears that NaN values returned by the Math functions are non > comparable to the NaN constant. According to E262-3 (section 8.5): > > "... to ECMAScript code, all NaN values are indistinguishable from > each other." > > I read this to mean that any of the 9007199254740990 (according to > E262-3) possible NaN values should be equivalent. > > .