Richard Maine wrote:
> In some cases, you need parens
> just to establish the mathematical meaning of an expression like
> a*(b+c). You don't really care whether or not the compiler evaluates
> it that way or expands it to a*b+a*c; whatever it finds faster is ok.
I'm sure this is just a bad choice of example to make a good point, but this is
one of the substitutions explicitly forbidden by the standard (although the
substitution in the other direction is allowed). It is possible for the second
expression to overflow when the first does not, if b and c are large and of
opposite sign.
Bill
--
William F. Mitchell
Mathematical and Computational Sciences Division
National Institute of Standards and Technology
[log in to unmask] http://math.nist.gov/~mitchell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|