Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
CptFox16196yTo be fair, NaN is kind of a number to computers : the IEEE 754 norm defines 3 exceptions to the way numbers are represented by float, that is ±0, ±inf and NaN.
So NaN is a legal value for a floating point number, and for once, JS is not to blame. -
@CptFox thanks for clarification. i find it intuitive for nan to be a number-type value because it just doesn't make sense to me to return anything else while checking if it is a number.
-
CptFox16196y@theofanis Sorry, but since we're talking JS, I'm really not sure we have the same 'this' (sorry, had to 😋)
-
CptFox16196y@TeeSeal Too lazy to check, but since IEEE 754 defines NaN as "all floats with non-null mantissa and with exponent at maximum value", it could be that NaN1 != NaN2 because they are literally not the same value. Although it makes sense to say that even NaN1 does not equal NaN1, to be safe
Related Rants
I don't get JS sometimes...-
joke/meme
js