Hacker News new | ask | show | jobs
by opnitro 839 days ago
Nit picking, but floating point is commutative either.

  1 + NaN == NaN
  Nan + 1 == NaN
  Nan != Nan

(NaN is defined as not being equal to itself)
2 comments

Nit picking, but floating point is not commutative either.
ya got me
Well then define it to be equal to itself ;)

NaN is a strange thing anyways, for example you cannot invert it so that NaN+(-NaN)=0