Long Longs

Frank Adams franka at mmintl.UUCP
Thu Mar 6 05:40:49 AEST 1986


In article <1434 at brl-smoke.ARPA> jon at cit-vax.ARPA (Jonathan P. Leech) writes:
>    Final cautionary note: [ from K&R Appendix	A  Sec.   7  (pg  185)
>Expressions ]:
>
>   "... Expressions involving a commutative and  associative  operator
>    (*, +, &, |,  ^)  may  be  rearranged  arbitrarily,  even  in  the
>    presence of parentheses; to force a particular order of evaluation
>    an explicit temporary must be used."

This would let the compiler rearrange

   a = (b * c) * d;

to

   a = b * (c * d);

but it does not permit

   a = (b * c) / d;

to be rearranged to

   a = b * (c / d);

at least if b, c, and d are of integral type.

Frank Adams                           ihnp4!philabs!pwa-b!mmintl!franka
Multimate International    52 Oakland Ave North    E. Hartford, CT 06108



More information about the Comp.lang.c mailing list