View Single Post
Old 11-14-2012, 12:51 PM   #13 (permalink)
jamesqf
Master EcoModder
 
Join Date: Jun 2008
Location: Earth
Posts: 5,209
Thanks: 225
Thanked 811 Times in 594 Posts
Quote:
Originally Posted by Old Mechanic View Post
I think adding parenthesees affects the calculation. Looks like 320 to me.
4x4=16
16+4=20
20x4=80
80+4=84
84-4=80
80x4=320
James calculation would give you 20
16+16+4=36
36-16=20

regards
Mech
Hey, thanks for proving my point! Remember that the order of operations is not left to right. Multiplication takes precedence over addition: you do the multiplications first, then add the results. So while you, writing your computer code in a careless moment, may have intended to get 320 as a result, your program really does get 20. And I have to go in and figure out why it's not working right :-(
  Reply With Quote