> Using, head, as many different calculators that you have to hand > (especially if you have an iPhone or Windows calc) what result do you get > from the following sum. > > 6/2(1+2) Note - in the following, unless specified otherwise) I'll assume a multiplication operator between he 2 and the ( as this is well understood to be implied and is not part of the central issue. OK. I'm "on a hiding to nothing here." I won't even sneak away and see what Wikipedia and other authoritative [tm] beguiling & incorrect sources say about operator precedence. I'll just blurt it out :-). The emperor has no clothes on. Everybody or almost everybody who has indicated a "correct"* solution so far is wrong. The only correct answer is 9. < flame shields u..... too lat ... Reverse the order of the two indivisible* portions. A =3D (1 + 2) * 6 / 2 Few would get other than "9" as an answer. This is entirely consistent with the basic rule of mathematics that B * C =3D C * B You can even extend that to Z =3D A * B / C =3D B * A / C =3D A / C * B =3D= B / C * A As long as you agree with the implicit / C means / C =3D 1 / C you can as validly write Z =3D A * B / C =3D / C * A * B =3D / C * B * A The above should be convincing enough to allow people to go back and assess what is wrong with what most people have been assuming about the original methods of solution that lead to an incorrect answer. This is, that he "scope" of the / operator is only a single number or bracketed expression - an implied preceding brackets is not presumed when an operator of equal precedence is encountered. The RPN solution is wrong because the method used to evaluate it removes information from the RPN process. Consider - in very complex expressions withe limited stack size is available an RPN evaluation should commence inside the most deeply nested bracket and work out. If that is correct for a complex expression it shold prodice a correct result for a simple one. So 1 ^ 2+6^2/* =3D 9 or 1 ^ 2+6*2/ =3D 9 The calculator that gave a zero result with the original expression is more correct than those which gave answers other than 9. Consider - how should 6/2z(1+2) evaluate. The "z" is clearly an illegal character and should ideally give an error message or, failing that, zero the result. So too 2( is an illegal sequence and should either be "corrected" to the generally understood 2 * ( or declared as an error. Yes? Russell * [tm] again. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .