In a message dated 1/14/2000 3:09:26 AM Pacific Standard Time,
[log in to unmask] writes:
> > and possibly optimise better.
>
> Why?
Applying commutivity may allow for recognition of common sub-expressions or
more parallelism in evaluation. Without "superfluous" parentheses, the
compiler is free to make such an analysis, although it may be time consuming.
If the program depends on a certain order e.g. to avoid over- or under-flow,
parentheses must be used.
I find it interesting that Fortran specifically permits compilers to employ
associativity to the expression (A*B + A*C) where other languages do not.
Can anyone explain breifely the background of this or provide a reference on
it?
Tim
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|