Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
natep
on Feb 13, 2010
|
parent
|
context
|
favorite
| on:
WTFJS?
How do you know isNaN() doesn't use this fact? In Java, the body of isNaN(n) is simply 'return n!=n;'
cdavid
on Feb 13, 2010
[–]
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++.
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: