4 ms·
What? `NaN` isn't some primitive constant like `true`, `false`, `null` or `undefined`? It _actually_ is a number?
by skerit 1y ago
What? `NaN` isn't some primitive constant like `true`, `false`, `null` or `undefined`?
It _actually_ is a number?
- dgroshev 1y agoYes! Since any function returning a float might need to return NaN, NaNs are represented as a special kind of float, with most bits unused.
- skerit 1y agoCool. Is that why NaN isn't equal to anything? Not even when comparing a NaN variable to itself? (I assume it's because you can't have some NaN values be equal, and others not)