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
No you dont - the google calculator shows you that it has translated your expression to 2^(3^2) and then gives you the answer to that.
Excel gives you the same answer to 2^(3^2)
My pocket calculator gives the answer 64 when I enter 2 power button 3 power button 2
I would be interested to know what is the source of your theory about the correct way of doing this. Is your theory saying that the notation 2 superscript 3 supersuperscript 2 must always convert to a programming language statement 2 ^ 3 ^2, but that this should always be evaluated as 2^(3^2)?
Perhaps it's top to bottom with exponentials.
I think that it's good practice to use parenthesis.
Rules of precidence and order of operation are OK to know, but are akin to using defaults all the time.
Just as rngData.Offset(23) is less clear than rngData.Offset(23, 0),
2^3^4 is less clear than 2^(3^4)
I think the "top down" rule cannot be applied in an Excel formula since there is no vertical (up/down) ordering of the numbers. Thus we have to make up a new rule for this situation since we are writing out the numbers on a straight line with the operand between the numbers (and without parenthetical grouping). You *could* say top down is right to left in such a case, but I don't see why that is the obvious choice. An equally obvious choice is to follow the same rule that other operands follow in such cases - to evaluate the expression left to right.
So, I would argue that this is not a bug but a choice about a rule to follow, and further that the particular rule chosen here is the conventional one consistent with how most computing programs behave in the same situation. By way of comparison, my TI-84 (which is no lightweight calculator) evaluates (and displays) 2^3^4 as 4096, exactly the same as Excel.
ξ