mortgageman
Well-known Member
- Joined
- Jun 30, 2005
- Messages
- 2,015
According to math rules 2^3^2 should equal 2^9 (you go right to left in this case). Excel gives 64. Is this a known bug?
Gene Klein
Gene Klein
Well the problem is (says me), is that the caret - IN EVERY OTHER REGARD THEN THIS LEFT TO RIGHT PRECEDENCE - acts exactly like the exponent with which the rest of the world is familiar.
Excel uses the caret as an operator that raises something to a power just like the power superscript in the standard math notation.
As far as I can see the only question at issue is whether it would have been a better Excel design decision for 2 (or more) carets in succession to be interpreted by Excel as stacked or non-stacked superscripts.
Since the caret is not used as a power operator in Mathematical notation the question could perhaps be rephrased as:
Should 2^3^2 be interpreted as stacked superscripts or dot product superscripts?
" I mean - what else would it mean?????"
Gene Klein
It is better not to assume that syntax rules for computer packages are all alike. On the contrary, there are differences among computing packages and merely applying the same syntax rules from one in another will lead to errors. What holds true here between computing packages is all the more so true between written forms and computing forms - you wouldn't get very far typing mathematical formulas into excel the same way you do on paper.Which would lead a reasonable person to think that it is a translation of the power superscript.
Actually, this decision did have to be made - although it was many decades ago. The first computer programmer to decide that a * would be used as a multiplication sign made such a decision. He also implemented the rules of precedence for his new machine. And decided that "x" would not work for multiplication - which by your viewpoint might be considered another bug -- e.g., why doesn't 2x3 equal 6? -- . Everything a computer does has had at some point to be decided and worked out in meticulous detail. This is not unusual and as a mathematician should not strike you as odd. Why did some mathematician "decide" at some point that 2·3 equals six. And another that 2(3) equals six. And another that 2x3 equal six. You forget that all these "innovations" also had their beginning, before they became "conventions".See this is where I lose you - it is sorta of like you saying to me "The * acts just like multiplication in math. However, we need a design committe to decide if 3*4*2 should also mean 3x4x2" I mean - what else would it mean?????
Probably John Backus and the FORTRAN team in 1953/4.The first computer programmer to decide that a * would be used as a multiplication sign made such a decision.
Well, to me its obvious that there are 2 possible meanings of 2^3^2. (This seems to be a widely held view since there are many implementations of the non-stacked approach and a few of the stacked approach.)
But if you cannot see the 2 possibilities then we will just have to agree to disagree.
In both cases the ^ means raise the evaluation of the expression to the left of the ^ to the power of the evaluation of the expression to the right of the the ^.If one of those "meanings" is (2^3)^2, then what would be the meaning of "^" in that example?
Gene Klein