Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Reason for operator precedence
Replies: 15   Last Post: Mar 15, 2006 8:56 AM

 Messages: [ Previous | Next ]
 matt271829-news@yahoo.co.uk Posts: 2,136 Registered: 1/25/05
Re: Reason for operator precedence
Posted: Mar 14, 2006 9:39 AM

briggs@encompasserve.org wrote:
> In article <1142342196.542632.294210@i39g2000cwa.googlegroups.com>, matt271829-news@yahoo.co.uk writes:
> >
> > Tony wrote:

> >> Hi all.
> >>
> >> Hope this isn't a silly question.
> >>
> >> I was wondering what the reason is for having multiple levels of operator
> >> precedence?
> >>
> >> Phrased another way, why is it that we don't just evaluate everything from
> >> left to right?
> >>
> >> Having multiple levels of precedence obviously adds complexity, so I assume
> >> there must be some payback. However, I don't see what it is.
> >>

> >
> > As far as addition/subtraction vs multiplication/division is concerned,
> > one reason is to ensure that the distributive property of
> > multiplication works sensibly. For example, we want 3*(4 + 6) = 3*4 +
> > 3*6 = 3*(6 + 4) = 3*6 + 3*4.

>
> Remember that what we're talking about here is merely a notational
> convention. It has nothing whatsoever to do with the distributive
> property of multiplication over addition.

And, to elaborate a bit more, I venture to disagree and suggest that
the convention *does* have to do with this property. I suggest that the
distributive property of * over + is one of the reasons - possibly the
main reason - why it is "natural" to view multiplication as "tighter"
than addition, and to want to interpret, say, 3*4 + 3*6 as (3*4) +
(3*6) rather than as ((3 * 4) + 3) * 6 or whatever.