IEEE 754 operations are nonassociative, but they are commutative (at least if you ignore the effect of NaN payloads).
IEEE 754 operations are nonassociative, but they are commutative (at least if you ignore the effect of NaN payloads).
You're supposed to do (a+b) to demonstrate the effect, because floating point subtraction that results in a number near zero is sensitive to rounding (worst case, a non-zero number gets you a zero number), which can introduce a huge error when a and b are very similar numbers.
The confusion between associativity and commutativity is the entire point of this thread!
As a side note: all compilers I'm aware of make almost no guarantees on preserving the value of NaN payloads, hence they consider floating-point operations to be fully commutative, and there's no general way to guarantee that they evaluate in exactly the order you specified.