The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 11,749
Registered: 12/4/04
Re: Reason for operator precedence
Posted: Mar 14, 2006 10:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <4416a498$>,
Tony <> wrote:
>Hi all.
>Hope this isn't a silly question.
>I was wondering what the reason is for having multiple levels of operator

So that polynomials and rational functions can be written
easily. That's essentially the main reason.

>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.

So, by "evaluting left to right", I assume that you mean that
something like

2 + 3 * 5

would evaluate to 25, since 2 plus 3 is five, and then multiplying
that by 5 yields 25.

A general quadratic polynomial, using standard operator percedence, is
written as:

ax^2 + bx + c

And it can be written in other orders easily if you want:

c + bx + ax^2

bx + c + ax^2


How would you have to write it if you simply evaluated left to right?
The smallest number of parenthesis I can come up with is:

axx + (bx + c)

which may obscure the degree. If you want to put in the square, you
would need to do something like

bx + c + (a(x^2)).

Higher degree polynomials would be even harder.

"It's not denial. I'm just very selective about
what I accept as reality."
--- Calvin ("Calvin and Hobbes")

Arturo Magidin

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.