Python -- floating point arithmetic

Paul Rubin no.email at nospam.invalid
Thu Jul 8 17:44:37 EDT 2010


Wolfram Hinderer <wolfram.hinderer at googlemail.com> writes:
> JFTR, it works because a+b == a+b (while I don't think that a+b == b+a
> holds for all a and b).

I'm pretty sure IEEE 754 addition is always commutative (except maybe in
the presence of infinity or NaN and maybe not even then).  It differs from 
rational or real-number arithmetic in that it is not always associative.
You can have (a+b)+c != a+(b+c).  



More information about the Python-list mailing list