logoalt Hacker News

adampunktoday at 8:22 PM1 replyview on HN

NaN is weird? No, NaN is normal*, NaN PAYLOADS are weird: https://anniecherkaev.com/the-secret-life-of-nan

*This is false, NaN is weird, though maybe it needs to be. It is nowhere written arithmetic on computers must be straightforward.


Replies

tialaramextoday at 8:57 PM

Actually none of the floating point value are normal :D

Although Almost All† Real Numbers are Normal, none of the floats are normal, and nor are most numbers any regular person would think of (possible exceptions Pi and Euler's Number which are conjectured to be Normal although it is unproven)

† Almost All is a term of art in mathematics, remember there are uncountably many real numbers, so the fact the Normals are also uncountable puts them at least in the right ballpark, unlike the rationals.