Are floating point numbers really commutative?

249 views Asked by At

It's said that floating point addition is commutative but not associative.

An example of it being non associative is the following:

(1 + 1e100) + -1e100 = 0, and 1 + (1e100 + -1e100) = 1

But doesn't this also prove that they are not commutative by the following:

1 + 1e100 + -1e100 = 0, and 1e100 + -1e100 + 1 = 1

0

There are 0 answers