[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conflicts between C standard and 754-2008

Hossam Fahmy wrote:
and without any parenthesis I assumed that the evaluation will always
proceed from left to right and I swapped the second and third term.
So we are getting:
(z-y)+x = 100

Without associativity there is no such thing as a "third term", so you
can't swap 2nd and 3rd terms, and the cited optimization rule does not

What would be allowed is replacing z-y+x with x+(z-y).

In any case, in the presence of NaNs FP addition may be non-commutative.

---Sent: 2011-01-06 13:25:41 UTC

754 | revision | FAQ | references | list archive