News for hackers. Stuff that matters.
Re:WTFJS? by natep on Friday February 12, 2010 @09:10PM (#1122389)
How do you know isNaN() doesn't use this fact? In Java, the body of isNaN(n) is simply 'return n!=n;'
Re:WTFJS? by cdavid on Friday February 12, 2010 @11:06PM (#1122518)
It depends on the implementation. In C, it is quite easy to have n != n optimized away when compilers have their compiler flags set on. That's why you should use isnan to test nan instead of any other techniques when using C or C++.