'Are floating point numbers really commutative?
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
