View Single Post
Esel Mann Esel Mann is offline
Whoopsies I was banned!!!
 
Esel Mann's Avatar
 
Join Date: Sep 2005
Location: Trying to Escape from FLA
Posts: 4,593
The confusion is coming from the order of operations and placing a precedence of multiplication over division and addition over subtraction.

firstly I believe it is generally accepted that when analyzing the equation for the operators present in the given equation, for each analysis step one moves from left to right.

secondly, many have mentioned or implied that there is a precedence between multiplication over division and addition over subtraction. I believe that the precedence is the following:

brackets/parenthesis
exponents
multiplication/division
addition subtraction

The key here is that when encountering either multiplication/division there is no precedence between the two other than analyzing from left to right. It is the same for addition/subtraction.

So for 48÷2(9+3) = ????

Firstly, moving left to right the first set of bracket or parenthesis encountered is the (9+3) term. Which results in 12. The equation is now at:

48÷2(12) = ????

Now we see that all that is left is multiplication and division. So moving from left to right:

48÷2 results in 24 so the equation then becomes:

24(12) = which is 288.


For the rules above though, don't take my word for it. Look it up. The above is all discussed in any C programming language reference manual. I suggest referencing Kernighan and Ritchies (they're the dudes who created C) "The C Programming Language".
Old 04-12-2011, 05:52 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #144 (permalink)