Square of a Negative Problem in Excel 2007 too...
Square of a Negative Problem in Excel 2007 too...
(OP)
However you may feel about it, the issue discussed in the following two threads shows up in Excel 2007 as well. Just wanted to warn anyone that has run into the problem...
thread507-156861: WARNING! Excel order of operations problem...
thread404-157296: WARNING! Excel order of operations problem...
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm





RE: Square of a Negative Problem in Excel 2007 too...
-5^2+5^2=50 in Excel (and should be zero) and the commutative law says that 5^2-5^2 should give the same answer, but it doesn't (it gives zero in Excel).
One way to "explain" it is that there is no such thing as a subtraction operator (it is +(-1)*) as in:
(-1)*5^2+5^2=0=5^2+(-1)*5^2 and the commutative law is satisfied
That way the it is clear that ((-1)*5)^2 which is positive and (-1)*5^2 is negative.
Most of the time I would do =A1^2 which always makes -5 into +25. I can't remember the last time I typed a number into an equation (even constants get stuck in cells and then named so something like "specific gravity" shows up as "SG" in the equation instead of AA35 or 0.72)
This is a good thing to know, but I'm still looking for a credit card calculator that knows that 1+5*7 =36 not 42.
David
RE: Square of a Negative Problem in Excel 2007 too...
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
The meaning of the symbols is ambiguous unless you use brackets, so the message to always use brackets is good advice, and I far as I saw, no-one disputed it.
By the way, it still works the same in Excel 2010, and I imagine it will continue to do so into the future.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
"Negative 5"^2=25
RE: Square of a Negative Problem in Excel 2007 too...
David
RE: Square of a Negative Problem in Excel 2007 too...
As you can tell from my responses, I was flabbergasted that there was even debate, let alone a LONG debate...
And yet you post again here, 4 years later?!
RE: Square of a Negative Problem in Excel 2007 too...
David
RE: Square of a Negative Problem in Excel 2007 too...
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
Last time I checked, one negative multiplied by the same negative number (negative number squared) is a positive number.
Why the discussions lasted so long was not because what I wrote was wrong, but the titles of the thread are misleading. What the arguments are is about order of operations, and not about squaring a negative number, which is what the title indicates!
sweringen proves my point on June 15, 06 (bottom link):
Let's rewrite that:
For the "Negative 5":
-("Negative 5")^2 + 5 = -20
[bold]You must square what's in the parentheses, ("Negative 5")^2 = 25.[/bold]
-(25) + 5 = -20
-25 + 5 = -20
-20 = -20
OH SNAP, he said the same thing I did!!!! The only difference is he multiplied the
So, the issue is not that Excel does not know how to square a negative number, but that the title of this post was written incorrectly. It falls more in line with an "order of operations when multiplying a negative 1 times a squared number.
FYI, in Excel 2000, 5^2--5^2=0
RE: Square of a Negative Problem in Excel 2007 too...
My preferred way to look at the logic of the way Excel handles it is that it treats a single "-" as being a subtraction operator if it is between two numbers, and a negative number indicator if not, or if the "-" is inside (). If there are two "-" signs, or a +-, it treats the first one as the operator and the second one as the negative indicator. So:
=25+5^2 = 50
=25+(-5)^2 = 50
=25+-5^2 = 50
But
=25-5^2 = 0
=25-(5)^2 = 0
All logical and consistent, but open to misinterpretation if you don't know the rules.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
The only thing that irritated me was zdas04 indicating that my "bald faced statement" was not right. I disagree with that statement, and still do not see how squaring a negative number is not a positive result. The wording is much different from the symbols, and it does mean something totally different.
RE: Square of a Negative Problem in Excel 2007 too...
The point of the discussion is not the math, it is a warning that Excel may give you an answer that deviates from your expectations. It is a pretty good assumption that everyone on eng-tips.com knows that (-5)*(-5)=+25. You can also safely bet that all of us know that writing unabigous equations is better than writing ambigious ones. The problem is that I expect that
-5^2+5^2 should equal 5^2-5^2
and in Excel it doesn't (in MathCAD it does). That tells me that I should never start an equation with a negative sign unless I'm really careful about brackets. I find that to be useful information and appreciate Swerengen pointing it out. Everyone uses ambigious arithmetic from time to time, and it is good to know the the assumptions that the software is using.
David Simpson, PE
MuleShoe Engineering
www.muleshoe-eng.com
Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips Fora.
"It is always a poor idea to ask your Bridge Club for medical advice or a collection of geek engineers for legal advice"
RE: Square of a Negative Problem in Excel 2007 too...
The point of my comment was that so many people are jumping up and down about how to properly enter the formula, but (IMO) so many have misinterpreted the word problem from the start (pretty much misusing the term negative).
This may be off base for what some argued, but I think it illustrates the point: For some it may come down to calling "-5" "minus 5". Personally I think this is incorrect, as it implies there is an operation going on. In our most basic of math (was it first grade?) we learned that "-5" is a "negative number" - it is a defined entity. Later, we learned to square that entity and get 25, not -25.
Swearingen's post basically proved the point that excel does properly square "-5" and the issue is more just that it is (IMO) poor form to start the equation with an operator. Excel allows you to do that with the "+" or"-" because it can be used to indicate a positive/negative number, not because it allows you to perform an operation before having the numbers to use in the equation.
It is not like you would enter "=/4*3" and expect to get "0.75". Does Mathcad solve that one? Excel does not like it.
The real question is how you (and Excel/Mathcad)interpret "-5^2" in his original posts . Is it"-5"^2 (squaring an entity), or is there an implied multiplication going on "-1*5^2" (taking the negative value of a squared entity)? That is where the long debate started. I stand behind:
-5="Negative 5"
"Negative 5"^2=25
I do this because because he defined it as "Square of a Negative", and I assert that the rest of you did not read the problem correctly.
RE: Square of a Negative Problem in Excel 2007 too...
David
RE: Square of a Negative Problem in Excel 2007 too...
This is particularly true in Mathcad because the edit cursor always underlines what is being operated on next. In the former case, the exponent operator only applies to the number. In the latter case, you have to purposely extend the edit cursor by hitting the space bar to ensure that the minus sign is included under the exponent.
As for "This is a good thing to know, but I'm still looking for a credit card calculator that knows that 1+5*7 = 36 not 42" that's why RPN was invented, and that's why I only use RPN calculators, when I have a choice.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
David
RE: Square of a Negative Problem in Excel 2007 too...
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
I contend that "negative 5" equals (-5). It is implying that you're wanting to square the whole thing.
Those semantics aside, I admit that my title for this post is glaringly incorrect, however, and I apologize.
This is as clear as I can put it, though:
-5^2 + 5^2 = 0
-x^2 + x^2 = 0
You would never question the latter, why would you question the former?
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
=-5^2 = 25
=--5^2 = 25
=---5^2 = 25
and so on
It seems that Excel treats any signs immediately after the initial = as being attached to the number, so will always yeild a positive result if squared. It works as if there are virtual brackets immediatly after the = and between the number and the ^, so:
=--5^2 = =(--5)^2 = 25
It works the same way with numbers and cell addresses:
=-A1^2 = 25 if A1 contains 5 or - 5
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
We all know * and / have higher precedence than addition and subraction. And exponentiation has higher still.
As already well discussed the unary negation operator is a different beast than the binary subtraction operator (even though both are identified with the same symbol and that's where the confusion comes in. In excel the unary negation operator has higher precedence than the exponentation.
So whether you have -5^2 or --5^2 or ---5^2, the -( ) operator gets evaluated before the exponentiation.
Sorry for beating a dead horse. An entertaining thread at any rate with good contributions from all (even though we all knew how to cope the first time someone mentioned paranetheses)
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
Now you mention it, I did know that; as used in the -- trick to get something evaluated first in a formula.
I just hadn't thought about it in this context.
Anyway, good point Pete.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
My guess is that it's now mathematically proven that two wrongs can make a right, or that some operator precedence inexperienced programmer wrote Excel and OO copied the mistake.
"The top of the organisation doesn't listen sufficiently to what the bottom is saying." Tony Hayward X-CEO BP
http://www.youtube.com/watch?v=hpiIWMWWVco
"Being GREEN isn't easy." Kermit
http://virtualpipeline.spaces.live.com
RE: Square of a Negative Problem in Excel 2007 too...
Operator Description
: (colon)
(single space)
, (comma)
Reference operators
– Negation (as in –1)
% Percent
^ Exponentiation
* and / Multiplication and division
+ and – Addition and subtraction
& Connects two strings of text (concatenation)
= < > <= >= <> Comparison
The unary negative is evaluated before exponentiation. It is also common in programming languages for unary operations to occur prior to binary operations.
Without parens to clearly indicate whether that leading '-' is a negation or part of an implied 0-, it does not seem unreasonable for the '-' to be a unary operator and evaluate it prior to the exponentiation.
Entering 0-5^2+5^2 gives the result of zero, excel correctly evaluating the '-' as a binary subtraction operator.
MathCAD forces clarity by inserting () if you want the square of negative 5, but in MathCAD you can see how it is going to parse the equation as it is being entered. Excel has to rely on the order of operations and they clearly state that the unary '-' will happen before the '^', exactly as expected.
RE: Square of a Negative Problem in Excel 2007 too...
"The top of the organisation doesn't listen sufficiently to what the bottom is saying." Tony Hayward X-CEO BP
http://www.youtube.com/watch?v=hpiIWMWWVco
"Being GREEN isn't easy." Kermit
http://virtualpipeline.spaces.live.com
RE: Square of a Negative Problem in Excel 2007 too...
First and most important, there are a few other languages where unary – has higher presedence than binary operators.... including mysql, quickbase, java. In all these languages -5^2=25. But it is not universal.
As a general rule (not specific to unary negation), unary operators are assigned higher precedence than binary for simpler parsing and more intuitive understanding. It's easier to show this concept with trailing unary operators (placed after the associated variable) than leading unary operators as in the following examples:
5 + 6!
Do you want it to give you 11! or 6! +5..... my guess is the latter so you want the unary operator to have higher precedence.
Another example would be boolean logic single quote for negation.
A OR B'
My guess is you want to evaluate the unary negation before the binary or.
Now in excel + and – are used for logical AND and OR and NEGATION:
so in excel logical A or B' would be expressed
A + -B
As a logical expression you again want it to evaluate unary – before binary +
Now lets switch it
logical A or B' would be expressed
-B + A
Again you want unary before binary
Now what if you are talking numbers (not logic)
-5 +3
Clearly we want the answer to be –2 and not –8. So if we are comparing the precedence of binary add/subtract with unary negate, we still have a strong preference for binary operator first!
Now one might argue that unary negation operator should be given equal precedence to the binary add/subtract and simply read left to right. Well then I would get an error when I try to evaluate
3 + -5
because it tries to evaluate the + before the quantity on the right has even been determined and it cannot.
The above evaluation error can certainly be overcome using a little more complex logic than simple operator precedence, but I hope this shows why as a general rule from a parsing perspective there is some incentive to treat unary operators as higher precedence.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
Might even be the same guy. We had a microprocessor design with a particular output inverted from its design spec. The design team left the company and designed to the same military spec, but in a different technology, and lo, the same inverted output appeared in their design.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
The reason I question whether it is the same is that we do not tend to put () around all our negative numbers.
5-10=-5 is typical, and that is how you wrote it from your first math class in grade school.
5-10=(-5)is not so typical.
Therefore, right or wrong based on the arguments, when I see -5^2 I think 25. This also would make more sense to the general public that would want to square a negative number.
You also seemed to do the same when you were going through your calculations:
In that instance, you did exactly what you say Excel does wrong, you made -5 into (-5)^2, and not -(5)^2. Like I said, that is because we take the number and treat it as a whole. You have done this because "x" is the entity "-5", and you knowingly are taking the opposite of that total quantity once squared.
Given that, I find that it strange that you would want to code in a constant in in such a way. If you want to subtract 25, then do so. Why go through so many steps? In your defense, and where I do not like what they do, is when you have =-A2^2. I would want that treated the way you indicate, but that fits in line with the equation using -x^2.
The point is there though for order of operations to be watched, and that is something I make sure of when I write code. Everyone should do the same, and take heed of your observation. They should also know if they are intending to square a negative number, or want the negative value of a squared number. Writing it in symbol form does not clarify either direction. Writing it in word form does.
RE: Square of a Negative Problem in Excel 2007 too...
-x^2 + x^2 = x^2 - x^2 = 0
Now, when you actually put a positive, real number in for x, suddenly it's false. That's a load of crap. It's not "usual," it's not "conjecture," it's not "opinion." It is, as I said in my first post, a standard in mathematics worldwide. Please, please go back to your school texts (or look it up in your children's texts) and you'll see. Understand that I mean no offense to the programmers out there, but you're not mathematicians. You can write it any way you like because they're your programs, but that doesn't mean it follows the standard rules of mathematics.
If I sat here and argued that -x^2 + x^2 = 2x^2 you'd all run me off this site. No educated person, from their first algebra class to however many letters they've added after their name, would say that this is true.
What is the problem? Why can't this be grasped? Why is there an argument? As I said earlier in this thread - I am FLABBERGASTED that there is even an debate, let alone a long debate.
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
RE: Square of a Negative Problem in Excel 2007 too...
-x^2 + x^2 = 2x^2
Is that correct? Am I losing it here?
Well, here's what I contend:
If a = b, then if I multiply both sides by a,
a^2 = ab, then if I subtract b^2 from both sides,
a^2 - b^2 = ab - b^2, then if I factor out an (a-b),
(a-b)(a+b) = b(a-b), then if I divide both sides by (a-b),
a + b = b, but since a = b (from the first line),
b + b = b, and therefore,
2b = b, and dividing by b, we get,
2 = 1
Hey, since we're throwing algebra rules out of the window, why can't 2 = 1?
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
Microsoft as usual wrote their own rule and gets 25.
RE: Square of a Negative Problem in Excel 2007 too...
Minus the quantity x squared is rather different from minus x squared. If x=5 the the first is -25 and the second is 25.
I thought that writing it out would help, but I guess not. Notice that I wrote minus x squared, not minus the quantity x squared. They are quite different. So, yes, minus x squared plus x squared equals two times the quantity x squared. On the other hand, minus the quantity x squared plus x squared equals zero.
If I were to write it out long hand and wanted the negative of the square I'd write -(x^2). Writing -x^2 is what I'd write if I meant (-x)^2. Absent other explicit indication of parsing it is intuitive that all unary operators be evaluated prior to any binary operators. If you want the square of minus 5 there is no way you can do the square first and get the right answer, you have to square the quantity minus 5. In other words:
5
CHS
x^2
5
x^2
+
has always returned 50 and always will. If you want the other result you need:
5
x^2
CHS
5
x^2
+
which gives a result of zero.
RE: Square of a Negative Problem in Excel 2007 too...
You are saying that unary -X is same as 0 - X
In that case what if you have
5*-3
or with cell addresses
A12*-A16
Then following the well-known rules (multiplication/division before add/subtract) then the first should be 5*0-3 = -3 and the 2nd should be A12*-A16 = -A16.
I can imagine now you are jumping out of your seat to tell me you didn't mean 0-X... you meant (0-X). Ok that's better. Then we have
-5^2 = (0-5)^2 = 25.
Seems like the 0-X logic intended to attack MS's approach ended up supporting MS's approach
I honestly don't think there is any one absolutely correct answer, but but I can understand why people like swearingen have preferences.
As I said in the other thread, there are enough legitimate reasons to bash Microsoft. This isn't one of the imo.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
Please don't take it too seriously.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
I agree with swearingen that if we lived in the algebraic world before computers, there is no doubt -5^2 = -25
But of course we don't live in that world. We have computers. I am typing on one right now.
Let's go back to the task of writing a parser. First step is to separate into blocks that have parentheses. The tough part is to evaluate stuff inside the center parentheses that has no more parentheses but possibly multiple operators and operands. We have to figure out what to do first with this group of operators and operands.
The simple approach is to define operator precedence. Start with highest-precedent operators, evaluate them and substitue in the results. Then move to next highest precedence operator. Continue to lowest and you're done.
So now let's say you want to do this and you want to proclaim as per algebraic convention that exponentiation has a higher precedence than unary negation (opposite of the excel way).
Use this rule to evaluate 3^-2
Right off the bat you're hosed. You have to feed –2 into the exponentiation but you haven't evaluated –2 yet. We have to do the unary negation before the exponentiation to evaluate this expression.
So the logical approach to eliminate this problem is to make the unary operators such as negation a higher precedence and the problem is avoided. It allows use of a simpler parsing algorithms.
The programmer simplifies his own life by making unary operators highest precedence. Maybe in your view his made your life more complicated. He has deviated from the pre-computer-age algebraic convention. But there is plenty of precedent to do it in the programming world. Whether it is "wrong" is in the eye of the beholder.
I imagine if microsoft knew in the beginning what they knew now, they'd reverse their approach and use the algebraic convention suggested by swearingen. But that's out of the question now... you don't want spreadsheets that have been in service for years to give different answers when the version of excel changes.
BTW 2=1 after dividing by (a-b).....it's a good one for those that haven't seen it.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
Visicalc did not use nor allow an "=" sign, and the plus and minus signs are unary operators that signify a numerical quantity following. Excel follows that lead, even in the case of
-A12-A12. If A1 is 5, the resultant is not -50, it's 0.
Interestingly, Visicalc gives 400 as the resultant for
-A12-A12 when A1=5, so Excel does adhere to PEMDAS more closely than Visicalc.
The bottomline here is that you should avoid starting any calculation in Excel, and probably any spreadsheet, with a leading minus sign.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
An expert is a man who has made all the mistakes which can be made in a very narrow field
RE: Square of a Negative Problem in Excel 2007 too...
Excel (2010) evaluates -5^2 as +25, even if you select "Transition formula evaluation" and/or "Transition formula entry" in Options - Advanced. Exactly what evaluations are changed by "Transition formula evaluation" I'm not sure.
Gnumeric does it the Mathematica way, i.e. it evaluates -5^2 as 25, but it inserts () around the -5, to make it clear what it is doing.
On reflection, I think it would be a good idea for Microsoft to copy Gnumeric in this regard (and several others).
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
Neither are Microsoft it seems.
If you go to Options-Advanced and click on the help icon it goes to the general help screen. If you type "transition" in the search box it tells you there is no help on transition.
If you search for help on Lotus you get a couple of irelevant responses, including some warning about phishing.
Hopeless.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Square of a Negative Problem in Excel 2007 too...
Say you wanted to find the roots of
-x^2 - 6x + 27 = 0
and you wanted to use the Quadratic Equation to do so.
What would you use for A?
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
This is fundamentally no different than the order of operands for atan2 functions, or the now OBE argument about "algebraic" vs RPN inputs. Excel and Mathcad had different atan2 conventions for which is the numerator, and which is the denominator. Is there really a "right" answer. No, because it's by convention only. The fact that Excel's parsing for leading minus signs dates back more than 30 years pretty much convinces me that arguing the point is futile and pedantic.
If you've already made your case to MS and unless you plan on creating a spreadsheet program with only "correct" conventions, then what is the point, other than to while away a bunch of hours arguing with a bunch of faceless entities on the Internet?
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
There is much about Microsoft to complain about, consistent parsing in excel isn't one of them.
RE: Square of a Negative Problem in Excel 2007 too...
The problem arose when there was so much push-back on the convention. I have yet to have any "faceless entities" come up with a textbook example of something to refute the convention that I have proffered, although several said that I should check my school books (which I did). You have to admit,though, it's been an interesting ride...
davidbeach, here we go about parsing and unaries again. Well, the roots are -9 and 3 (you don't have to use the quadratic equation if you don't want to). Oooh - but the roots suddenly can't be -9 and 3 because of you plug those back in, you won't get 0, you'll get 162 or 18! Could you please tell me what the actual roots are then?
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
Perhaps you run a different Mcad version. I run 12.1, and I see no way that it explicitly shows its parsing; it just returns an answer.
RE: Square of a Negative Problem in Excel 2007 too...
-(3^2)-6*(3)+27=0
I've no idea where your 162 or 18 come from.
Is it so difficult to understand that how you enter an equation depends on where you are entering it.
Unary negation and binary subtraction use the same character to do two different and distinct things. That's probably a bad choice, but it's too well established to change at this point.
Explain, then why excel should parse
-5^2
differently from
5^-2
In both cases there is a unary negation. In one case it is clearly impossible to perform the exponentiation before the negation, so the negation has to happen first. But you want a different rule for the other one, do the exponentiation and then do the negation? That would be hopelessly more confusing than the present situation.
With implicit parsing it is much better to have complete consistency in how the equation is parsed (even if you find the parsing rules less than optimal) than to situational parsing rules (i before e except after c or...).
In your original problem you are welcome to enter it as
=0-5^2+5^2
Excel will then treat the '-' as a binary subtraction and you can then rearrange to
=0+5^2-5^2
and get the same result. You could even enter the original as
=-(5^2)+5^2
and force excel to parse the equation the way you want. That can then be rearranged to
=5^2-(5^2)
and again you get the same result.
You just can't tell excel to square -5 and expect to get -25, but I still don't understand why you want the square of -5 to be -25 anyway.
RE: Square of a Negative Problem in Excel 2007 too...
The simple answer to your parsing of -5^2 vs 5^-2 is that you have written it incorrectly. Any expression as an exponent should be written with parenthesis: 5^(-2). That expression is to be evaluated first, then the exponentiation takes place. This is another of those bits that was taught in school that you may have also forgotten.
I'm going to go ahead and throw in the towel. I stand by the order of operations that mathematicians are using world wide, as supported by texts and hard-core math programs (of which Excel is surely not). If anyone comes across a math text that refutes it, please let me know...
If you "heard" it on the internet, it's guilty until proven innocent. - DCS
http://www.eng-tips.com/supportus.cfm
RE: Square of a Negative Problem in Excel 2007 too...
What "other side of the fence"? As far as I can see everyone is agreed that it's a good idea to use brackets when exponentiating with negative numbers.
As for the question, A is -1 of course, and my version of Excel gives -1*5^2 = -25.
I don't really care whether Excel is a "hard core math program" or not. I'll continue to use it for everything other than solving large FEA problems, and continue to get my work checked by someone else before going to construction, just like I would if I was using any other calculation tool.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Square of a Negative Problem in Excel 2007 too...
I think the issue is that it's already been hashed out twice, and obviously, while people claim that they're tired of discussing it, they just can't help themselves, thereby compounding the problem.
So the furor is not that you're saying anything wrong, it's just that it's been said already, and we don't want someone to present yet another opportunity to waste a perfectly good hour rehashing old stuff because we can't help ourselves.
There's a tolerably OK search engine that can find the previous discussions, so there's really no need to *bump* the discussion. If you're really that passionate about the subject, a FAQ entry would be the most logical thing to do, not that those people reads the FAQs, either...
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Square of a Negative Problem in Excel 2007 too...
RE: Square of a Negative Problem in Excel 2007 too...
However, my only argument was based on the words of the thread not matching what he intended to say.
The argument has been "Square of a Negative" vs "Negative of a Square", which is what swearingen should have said for me not to have responded.
RE: Square of a Negative Problem in Excel 2007 too...
When in Mathcad, if you look at the unlining that occurs during the entry of -5, you:
> start with a red cross cursor
> enter "-"
> you get a blue vertical line with a placeholder square that is underlined. The underlining tells you what Mathcad considers to be a mathematical entity at that point
> enter "5" into the placeholder
> the vertical bar moves to the right of the 5, but the underline still only encompasses the "5"
> if you hit "^" at that point, the exponent applies only to the 5
> if you hit spacebar once, the underline extends underneath the minus sign. if you now hit "6" the exponentiation occurs, but parentheses are inserted to include the entire "-5"
TTFN
FAQ731-376: Eng-Tips.com Forum Policies