3 ms·
Common sense approach: like the name says, NaN is not a number. The question was about floating point numbers, not floating point values. So I suppose we should
by amelius 10y ago
Common sense approach: like the name says, NaN is not a number. The question was about floating point numbers, not floating point values. So I suppose we shouldn't count NaN. Further, -0 (an arbitrarily small number less than 0) doesn't logically fall in the range [0, 1], so it is excluded.
- mark-r 10y agoThere's no need to exclude -0.0, since mathematically and by all tests available to the floating point unit it's equal to +0.0.