Quote:
Originally Posted by Old Mechanic
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 :-(