Bug in Excel handling exponents

S

Schizoid Man

If I type -10^6 in a cell, the resulting number is 1,000,000. However,
shouldn't the exponent take precedence over the sign? Specifically,
shouldn't the result be -1,000,000?
 
D

Dave Peterson

Search for "Precedence" in excel's Help. (I used xl2003.)

And you'll find out how excel treats arithmetic operators.

It's not what you learned in school.

But those are excel's rules. So you have to play by them if you stay in excel.
Personally, I'll add ()'s to make sure the expression evaluates like I want.
 
S

Schizoid Man

Dave Peterson said:
Search for "Precedence" in excel's Help. (I used xl2003.)

And you'll find out how excel treats arithmetic operators.

It's not what you learned in school.

But those are excel's rules. So you have to play by them if you stay in
excel.
Personally, I'll add ()'s to make sure the expression evaluates like I
want.

I understand that the workaround could be -(10^6) but this explicitly
violates the rules of mathematical precedence, where negation has the same
level of precedence as subtraction.

A critical flaw for any mathematical purist.
 
B

Bernard Liengme

For you, the negative sign in -10^6 is a binary operator
When Excel sees =-10^6 it treats the sign as a unary operator, there is just
one operand (-10)
Excel treats it a binary operator in =0-10^6 since we now have two operands
(0 and 10)
Use the Evaluate Formula tool to see this
I think Excel takes the logical approach
best wishes
 
D

Dave Peterson

I don't think mathematical purity and excel are phrases that commonly used in
the same sentence.
 
J

joeu2004

I understand that the workaround could be -(10^6)
but this explicitly violates the rules of mathematical
precedence, where negation has the same level of
precedence as subtraction.

A critical flaw for any mathematical purist.

Utter nonsense! That is like complaining that German grammar
"violates" the rules of English grammar.

Mathematics is a language. Excel is another language.

If Excel positioned itself as a computer language for expressing
mathematical formulas (cf. FORTRAN), you might have a valid argument.

But if you know the history of Excel (hint: see Visicalc), you would
know that is not the case.

In any case, "when in Rome, learn to speak Italian".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top