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
For the two equations:

48÷2(9+3)

16 ÷ 2[8 – 3(4 – 2)] + 1

Why not try pumping them into excel and see what you get?

for excel one would pump in:

=48/2*(9+3)

=16/2*(8-3*(4-2)) + 1

my excel returns 288 and 17 respectively.


Also, another way to look at the first equation:

48÷2(9+3) = 48÷2(9) + 48÷2(3) = 24(9) + 24(3) = 288

and another way to look at the second equation:

16 ÷ 2[8 – 3(4 – 2)] + 1 = (next line as expanded is longer)

16 ÷ 2[8] - 16 ÷ 2[3(4 – 2)] + 1 =

16 ÷ 2[8] - 16 ÷ 2[3(4)] + 16 ÷ 2[3(2)] + 1 =

8[8] - 8[3(4)] + 8[3(2)] + 1 = 17

The debate here is the notion that multiplying something in parenthesis gives the multiplier a higher precedence over simple left to right. The C reference I mentioned (and I could dig for other references which would agree if necessary), plus the results from excel suggest that the left to right rule applies.

If there is a reference or source out there which states that multiplying something in parenthesis takes a higher precedence over the simple left to right rule, please share with us!!!
Old 04-12-2011, 09:44 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #153 (permalink)