Addition mathematically holds the associative property:
(a + b) + c = a + (b + c)
In the general case, this property does not hold for floating-point numbers because they represent values in a finite precision.
Is a compiler allowed to make the above substitution when generating machine code from a C program as part of an optimization? Where does it exactly say in the C standard?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…