Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » sci.math.* » sci.math.independent

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
matt271829-news@yahoo.co.uk

Posts: 2,136
Registered: 1/25/05
Re: Reason for operator precedence
Posted: Mar 14, 2006 8:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Dik T. Winter wrote:
> In article <1142342196.542632.294210@i39g2000cwa.googlegroups.com> matt271829-news@yahoo.co.uk writes:
> > Tony wrote:
> ...
> > > I was wondering what the reason is for having multiple levels of operator
> > > precedence?

> ...
> > 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.
> >
> > And for exponentiation we want, for example, 3*3^2 = 3^3, not (3*3)^2

>
> That is not the reason. You could just as well have left to right
> operation when you use sufficiently many parenthesis in the euqations.
> E.g. 3*(4 + 6) = (3*4) + (3*6).


Well, obviously any precedence can be enforced with parentheses. I
meant make it work *without* the need for parentheses, just as in your
example below.

>
> But try to write the polynomial x^7 + 2x^6 - 3x^5 + 2x^4 +7x^3 - 3x^2 - 5x + 8
> without assuming precedence. It is to avoid large numbers of parenthesis.





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.