logoalt Hacker News

Two Case Studies of NaN

8 pointsby theanonymousonetoday at 8:22 AM5 commentsview on HN

Comments

aragilartoday at 10:25 AM

You don't need NaN (or Inf) to have unexpected behaviour with floats and naive loops in lua, using 1e52 is enough. Conflating floating point and integers (independent of encoding) is always a bit of a trap.

jjgreentoday at 8:45 AM

      hypot(Inf, NaN) == Inf
made me laugh out loud ...
show 1 reply