3 ms·
According to http://stackoverflow.com/a/1573715 http://stackoverflow.com/a/1573715 the IEEE-754 committee decided to make NaN != NaN in order for programmers to
by jks 12y ago
According to http://stackoverflow.com/a/1573715 http://stackoverflow.com/a/1573715 the IEEE-754 committee decided to make NaN != NaN in order for programmers to have a simple way of detecting NaN before there was a standardized isnan function or macro.
- chrisdevereux 12y agoI'm lacking sleep a bit here, but wouldn't NaN == NaN do the same trick?
- kazinator 12y agoYes, if you take the false result to be the indication that you have a NaN. Either polarity comparison will work, if you correctly interpret its result.