Hacker News new | ask | show | jobs
by aleph_minus_one 853 days ago
> and that float operations are not commutative. At the end of the day, 0.1 + 0.2 != 0.3 is a fact you have to live with.

Addition and multiplication of floating point numbers is commutative (sole theoretical exception: there principally exist multiple representations of NaNs, even though in practice processors do not make use of this freedom, i.e. in practice these floating point operations are completely commutative).

1 comments

Yes, but not associative. I guess this is what GP was trying to say (and which actually can cause issues).