View Single Post
  #14   Report Post  
Dana DeLouis
 
Posts: n/a
Default

I think the consensus is that Excel is wrong in this calculation, and most
likely will never be fixed. I think the problem is that Excel can not look
ahead in its interpretation of the equation to see that ^ would come first,
and then take the negative of this number. I agree with Harlan as it
appears Excel can only read Left to Right, and that's it. A program like
Mathematica can read the whole expression correctly.

For a small demo, Excel does the following left to right only...
=4^3^2
4096

But Mathematica will do this correctly as 4^(3^2)
4^3^2
262144

As you can see, Excel just can't look ahead to do it properly.

I've never liked the help file explanation on Operator precedence.
"Negation (as in -1)" Negation I think usually means True / False. I think
we have to guess that what they mean is that it will flip the sign bit of
the number if this is what's seen first (and disregard anything later as in
^). My thoughts are this is not a very good explanation.

http://mathworld.wolfram.com/Negation.html

Just some other thoughts. A nice feature of Excel though is its ability to
interpret text as numbers where appropriate. This is a "nice" feature for
Excel, but not for a math program. For example, if A1 had the text '5

You could use = - - A1 to get the number 5.
Same with =A1+0

Of course, in Mathematica you could not add the text "5" and zero to get 5.
And the - - A1 is the PreDecrement operator, so this would not make sense in
Mma.

If A1 held the number 5, in Excel, you could have a formula like:
=A1--------2
7

This would not make sense in Mathematica.

You may want to look at the "InputForm" of Mma equation and use the same
"Power" function with Excel. Using Excel's Power function is a good way to
make it clear what you are doing. I have experimented with putting a "Hold"
around the equation (via "HoldForm") and work with the Power pattern, but
never had much luck with this approach myself. Once you put a Release on
the hold, the equation will simplify again. I do have a custom //Vba
function that transforms the output into the format for Excel's vba, but it
doesn't cover everything.

For a simple demo. If you were not sure, and want to enter =4^3^2 in Excel,
you may want to take a look at how this is done, and use the power function
in Excel.

FullForm[HoldForm[4^3^2]]

Power[4,Power[3,2]

I would take the hint and do it like this in Excel
=POWER(4,POWER(3,2))

And for those interested ...
FullForm[HoldForm[-5^2]]
Times[-1, Power[5, 2]]

--
Dana DeLouis
Win XP & Office 2003


"Atreides" <atreides1AThotmailD0Tcom wrote in message
...
Ken, I am in immense respect of you! I've just read the entire topic on
this
bug on the google newsgroup... no-one really listening, just arguing,
ego's
flying etc. Your humilty and gentleness is very pleasantly refreshing!

Cheers to you! :)