Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Conflicts between C standard and 754-2008



On Jan 13 2011, Vincent Lefevre wrote:

>No, you're also using the associativity here, because a+b+c is
>interpreted unambiguously as (a+b)+c. And from (a+b)+c to (a+c)+b,
>you're not using the commutativity only, but a succession of
>commutativity and associativity transformations.

No, that is NOT true, and never has been!  Please stop propagating that
myth.  The word that is false (and I mean false) is "unambiguously", and
without that it is still misleading.  All that is unambiguous is the
PARSING - the evaluation has NEVER been clearly specified.

The evaluation is just a consequence of the parsing. If you follow the
grammar (which specifies expressions), a+b+c is equivalent to (a+b)+c,
and the C standard has no rules concerning explicit parentheses.

And that is PRECISELY what is a myth.  As I said, there is nothing in
the standard that states the evaluation must mirror the parsing, and
some wording that indicates that it need not.

The interpretation of the C standard was drifting towards the parsing
order being the evaluation order, for different reasons, but WG14 has
NEVER clarified this point.

Remember that I was answering something related to F.8.2, so that we
are under the context of Annex F (IEEE 754 standard).

As I also said, Annex F contains NOTHING on this point.


Regards,
Nick Maclaren.