April 29th, 2011, 02:16 PM
Join Date: Jun 2010
Location: New Mexico, USA
Device(s): M8, LTEvo, 3vo, and Shift - Evo retired
Thanked 57,187 Times in 22,979 Posts
A*B*C = A*C*B
It's not operator location that implies precedence - it's only operator type and parens that set that.
Probably the only reason the confusion ever existed is because at some point around 20 years ago compilers popularly ended up whenever there was code like this and evaluating multiplications first, then divisions - leading to computation tools that enforced the thinking that leads to the wrong conclusion.
are both correctly hand-written notations of two different problems.
6/2(1+2) is machine-form (the typewriter) notation - and so only the conservative and strict rules may apply, to free from compiler confusions.
A * B * C = A * C * B
A / B * C = A * C / B
Therefore = 9.