> For [[Floating-point number|floating-point numbers]], $(a+b)+c$ and $a+(b+c)$ can give different results - [[Floating-point number|floating-point]] [[Addition|addition]] is not [[Associativity|associative]]. ^claim Every [[Addition|addition]] rounds its result to the bits available. A different order rounds different intermediate results, so the final rounding error differs too. ```python (0.1 + 0.2) + 0.3 # 0.6000000000000001 0.1 + (0.2 + 0.3) # 0.6 ``` ^example Mixing large and small numbers makes it worse - a small number [[Addition|added]] to a huge one can vanish entirely: ```python (1e16 + 1) - 1e16 # 0.0 1e16 - 1e16 + 1 # 1.0 ```