Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I've recently noticed that Excel flies in the face of standard scientific,
mathematical and engineering convention in the calculation of powers for numbers that are then multiplied by a negative. The convention of mathematics, "BIMDAS" (or similar acronyms), states that _I_ndices (or powers, or exponents), should be calculated before _M_ultiplication. Because of this, the following is accepted as correct: -3^2 = -9. This is because it is the equivalent of (-1) * 3^2 = -1 * 9 = -9 However, Excel chooses to recognise this as (-3)^2 = 9. This error is particularly problematic when doing algebraic computations in such a tool as Mathematica and then copying the result into Excel in input form. That is, -x^2 - -A1^2 - -A1^2 (Mathematica) (Mathematica with reference substituted) (Excel) To correct the error, one must manually change it to: -(A1^2) QUESTIONS 1: Why does Excel have this convention! 2: Is there any way to change it/make is more convenient? I've only recently noticed this (which is quite scary to think how many errors I may have made in the past!) Thanks for your time, Cheers, Peter |
#2
![]() |
|||
|
|||
![]()
Why? Because that's the way they wrote it. And no, there's no way to change
this. You must write your Excel formulas to a suit the way Excel does the calculations. On Mon, 21 Feb 2005 19:47:02 -0800, "Atreides" <atreides1AThotmailD0Tcom wrote: I've recently noticed that Excel flies in the face of standard scientific, mathematical and engineering convention in the calculation of powers for numbers that are then multiplied by a negative. The convention of mathematics, "BIMDAS" (or similar acronyms), states that _I_ndices (or powers, or exponents), should be calculated before _M_ultiplication. Because of this, the following is accepted as correct: -3^2 = -9. This is because it is the equivalent of (-1) * 3^2 = -1 * 9 = -9 However, Excel chooses to recognise this as (-3)^2 = 9. This error is particularly problematic when doing algebraic computations in such a tool as Mathematica and then copying the result into Excel in input form. That is, -x^2 - -A1^2 - -A1^2 (Mathematica) (Mathematica with reference substituted) (Excel) To correct the error, one must manually change it to: -(A1^2) QUESTIONS 1: Why does Excel have this convention! 2: Is there any way to change it/make is more convenient? I've only recently noticed this (which is quite scary to think how many errors I may have made in the past!) Thanks for your time, Cheers, Peter |
#3
![]() |
|||
|
|||
![]()
Why? Because that's the way they wrote it.
Why is the sky blue? Because. ;) I was hoping for something more informative than this. e.g. 1. This convention was considered more intuitive to the majority of expected users. 2. Computer programmers live in their own world and have their own conventions. 3. Other... And no, there's no way to change this. Perhaps this should be included in the next version of Excel. Some other options can be changed with regards to the calculations (by going to "Tools", "Options", "Calculation"). This would be quite a useful feature. Thanks Peter |
#4
![]() |
|||
|
|||
![]()
Maybe is skewed. I was taught that -3^2=9, and not -9. The integer used
is -3, not -1*3. You may think I was taught wrong. I submit to you I was not taught in this country, rather, I grew up in Europe. Could it be that Excel had some European programmers.... Roy "Atreides" <atreides1AThotmailD0Tcom wrote in message ... Why? Because that's the way they wrote it. Why is the sky blue? Because. ;) I was hoping for something more informative than this. e.g. 1. This convention was considered more intuitive to the majority of expected users. 2. Computer programmers live in their own world and have their own conventions. 3. Other... And no, there's no way to change this. Perhaps this should be included in the next version of Excel. Some other options can be changed with regards to the calculations (by going to "Tools", "Options", "Calculation"). This would be quite a useful feature. Thanks Peter |
#5
![]() |
|||
|
|||
![]()
Maybe is skewed. I was taught that -3^2=9, and not -9. The integer used
is -3, not -1*3. You may think I was taught wrong. I submit to you I was not taught in this country, rather, I grew up in Europe. Could it be that Excel had some European programmers.... This could have something to do with it. However, the convention -x^2 == -(x^2) is not negotiable when you are working with algebra. If you are dealing with real numbers, then writing -x^2 would be pointless if -x^2 really means (-x)^2 == ( -1)^2 * (x)^2 = x^2 Therefore, if the "European convention" you mention holds, then -x^2 == x^2. (!) So then, -x^2 should be taken as -(x^2), to mean the opposite of the square of x, and to differentiate it from simplifying to x^2. Cheers, Peter **PS** The post that Alan mentioned (http://tinyurl.com/5t69s) is good reading on this topic. Apparently the issue cost someone $2000 in time and effort to resolve! The convention as I've learnt it is that the power operator is only applied to the argument immediately under the indice. So for instance: 2 * 3^2 = 2 * 9 = 18 AND (2 * 3)^2 = 6^2 = 36 (2 * 3)^2 = 2^2 * 3 ^ 2 = 4 * 9 = 36 Therefore, if the negative is meant to be included in the power, it should be included in brackets. So then: -3^2 = -1 * 3^2 AND (-3)^2 = 9 (-3)^2 = (-1 * 3)^2 = (-1)^2 * (3)^2 = 1 * 9 = 9 |
#6
![]() |
|||
|
|||
![]() "Atreides" <atreides1AThotmailD0Tcom wrote in message ... Maybe is skewed. I was taught that -3^2=9, and not -9. The integer used is -3, not -1*3. You may think I was taught wrong. I submit to you I was not taught in this country, rather, I grew up in Europe. Could it be that Excel had some European programmers.... This could have something to do with it. However, the convention -x^2 == -(x^2) is not negotiable when you are working with algebra. If you are dealing with real numbers, then writing -x^2 would be pointless if -x^2 really means (-x)^2 == ( -1)^2 * (x)^2 = x^2 Therefore, if the "European convention" you mention holds, then -x^2 == x^2. (!) I'll add my comment - Yes, this is correct, and this is what I was taught (many moons ago). However, I see you point as well and find myself more agreeable with it than my own 'paradigm', if you will. Thanks! So then, -x^2 should be taken as -(x^2), to mean the opposite of the square of x, and to differentiate it from simplifying to x^2. Cheers, Peter **PS** The post that Alan mentioned (http://tinyurl.com/5t69s) is good reading on this topic. Apparently the issue cost someone $2000 in time and effort to resolve! The convention as I've learnt it is that the power operator is only applied to the argument immediately under the indice. So for instance: 2 * 3^2 = 2 * 9 = 18 AND (2 * 3)^2 = 6^2 = 36 (2 * 3)^2 = 2^2 * 3 ^ 2 = 4 * 9 = 36 Therefore, if the negative is meant to be included in the power, it should be included in brackets. So then: -3^2 = -1 * 3^2 AND (-3)^2 = 9 (-3)^2 = (-1 * 3)^2 = (-1)^2 * (3)^2 = 1 * 9 = 9 |
#7
![]() |
|||
|
|||
![]()
Royman101 wrote...
Maybe is skewed. I was taught that -3^2=9, and not -9. The integer used is -3, not -1*3. You may think I was taught wrong. I submit to you I was not taught in this country, rather, I grew up in Europe. Could it be that Excel had some European programmers.... I have a few German language math texts that show equations that clearly show they follow exponentiation before negation operator precedence. Perhaps it may be unreasonable to extrapolate from that that Germany follows the same operator precedence convention as the US, but I'd be willing to bet that was so. |
#8
![]() |
|||
|
|||
![]()
"Atreides" <atreides1AThotmailD0Tcom wrote...
.... I was hoping for something more informative than this. e.g. 1. This convention was considered more intuitive to the majority of expected users. .... Perhaps now, but not necessarily back when spreadsheets made their big debut in the mid 1980s. FWLIW, this is COBOL's sign convention, and maybe it wasn't unreasonable for Microsoft's original Excel programmers to decide that it'd be a good idea to follow COBOL operator precedence. Then again, Lotus 123 follows standard mathematical conventions and gives exponentiation higher precedence than unary minus (sign change), so Microsoft's original programmers gave Excel a different operator precedence convention than the leading spreadsheet on the market back when they were developing the original version of Excel. That alone makes it VERY LIKELY this was a design screw-up, but once made it can't be unmade because it'd break existing formulas relying on current operator precedence. If you really believe you want to read about this, follow these archived threads. http://groups-beta.google.com/group/...214f129ec55664 http://groups-beta.google.com/group/...fc5978cbbd95a8 And no, there's no way to change this. Perhaps this should be included in the next version of Excel. Some other options can be changed with regards to the calculations (by going to "Tools", "Options", "Calculation"). This would be quite a useful feature. Don't count on this happening. Excel's formula parser, in which its operator precedence is implemented, seems to be one of the oldest, most myopically designed bits of code in all of Excel. If Microsoft hasn't made any fundamental changes since Excel 4 (3D referencing within .XLW workbooks), over a decade ago, why would you believe they have any inclination to fix this any time soon? Also, flipping operator precedence on the fly would require a different formula parser of every possible operator precedence combination. That'd add considerable bulk to the Excel .EXE - not a good thing. |
#9
![]() |
|||
|
|||
![]()
Who would would possibly know why they did it this way? What's the point of
wasting time speculating about WHY? You have a problem to solve. I would think your time would be better spent on that aspect. Fundamentally, you need to add parentheses to an expression like -X^2 so it becomes -(X^2). It is VERY unlikely this will be changed. It could "break" existing spreadsheet formulas that have been written to accommodate Excel's calculation order. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... Why? Because that's the way they wrote it. Why is the sky blue? Because. ;) I was hoping for something more informative than this. e.g. 1. This convention was considered more intuitive to the majority of expected users. 2. Computer programmers live in their own world and have their own conventions. 3. Other... And no, there's no way to change this. Perhaps this should be included in the next version of Excel. Some other options can be changed with regards to the calculations (by going to "Tools", "Options", "Calculation"). This would be quite a useful feature. Thanks Peter |
#10
![]() |
|||
|
|||
![]()
Who would would possibly know why they did it this way? What's the point of
wasting time speculating about WHY? When confronted with something that is so incredibly against convention (and that I have somehow not noticed for the last 10 or so years), it pulls terribly at my curiosity. Also, to increase my understanding of computers and calculating program. You have a problem to solve. I would think your time would be better spent on that aspect. Fundamentally, you need to add parentheses to an expression like -X^2 so it becomes -(X^2). Yes, this is the obvious fix. However, I have been (and will continue to) copy formulas from Mathematica (in Input Form, which is almost identical to Excel format, except for issues like this). If I could avoid all past and future manual changes to be spreadsheets, this would be incredibly valuable. But alas. Here's to checking assumptions... Cheers, Peter |
#11
![]() |
|||
|
|||
![]()
"Atreides" <atreides1AThotmailD0Tcom wrote in message
... I've recently noticed that Excel flies in the face of standard scientific, mathematical and engineering convention in the calculation of powers for numbers that are then multiplied by a negative. The convention of mathematics, "BIMDAS" (or similar acronyms), states that _I_ndices (or powers, or exponents), should be calculated before _M_ultiplication. Because of this, the following is accepted as correct: -3^2 = -9. This is because it is the equivalent of (-1) * 3^2 = -1 * 9 = -9 However, Excel chooses to recognise this as (-3)^2 = 9. This error is particularly problematic when doing algebraic computations in such a tool as Mathematica and then copying the result into Excel in input form. That is, -x^2 - -A1^2 - -A1^2 (Mathematica) (Mathematica with reference substituted) (Excel) To correct the error, one must manually change it to: -(A1^2) QUESTIONS 1: Why does Excel have this convention! 2: Is there any way to change it/make is more convenient? I've only recently noticed this (which is quite scary to think how many errors I may have made in the past!) Thanks for your time, Cheers, Peter Hi Peter, See this thread for a *very* comprehensive discussion on the topic: http://groups.google.co.nz/groups?hl...umbus. rr.com Or this (same thing but shorter URL): http://tinyurl.com/5t69s Enjoy! Alan. |
#12
![]() |
|||
|
|||
![]() |
#14
![]() |
|||
|
|||
![]()
Doesn't -(x^2) satisfy -9?
-- Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... But then Ken, what reason would one have for writing: -x^2 if it really simplifies down to -x * -x = x^2? How would one write the opposite of the square of x? Cheers, Peter "Ken Russell" wrote: -3^2 is the same as -3*-3 which equals 9 not -9 At least that's what I was taught over 60 years ago. -- Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... I've recently noticed that Excel flies in the face of standard scientific, mathematical and engineering convention in the calculation of powers for numbers that are then multiplied by a negative. The convention of mathematics, "BIMDAS" (or similar acronyms), states that _I_ndices (or powers, or exponents), should be calculated before _M_ultiplication. Because of this, the following is accepted as correct: -3^2 = -9. This is because it is the equivalent of (-1) * 3^2 = -1 * 9 = -9 However, Excel chooses to recognise this as (-3)^2 = 9. This error is particularly problematic when doing algebraic computations in such a tool as Mathematica and then copying the result into Excel in input form. That is, -x^2 - -A1^2 - -A1^2 (Mathematica) (Mathematica with reference substituted) (Excel) To correct the error, one must manually change it to: -(A1^2) QUESTIONS 1: Why does Excel have this convention! 2: Is there any way to change it/make is more convenient? I've only recently noticed this (which is quite scary to think how many errors I may have made in the past!) Thanks for your time, Cheers, Peter |
#15
![]() |
|||
|
|||
![]()
Doesn't -(x^2) satisfy -9?
Yes, according to your convention, you would have to write -(x^2). So consider the two systems we could have: 1. x^2 the opposite of which is -x^2 2. x^2 the opposite of which is -(x^2) System number one (which, in my experience, is standard in maths, science and engineering textbooks) makes more sense to me. Indices or powers have precedence over multiplication. Consider graphs of parabolas. According to your definition, the graphs: y = x^2 AND y = -x^2 would be the same graph. However, in my experience, eveyone knows that y = x^2 is a "U" shape while y = -x^2 is an "upsidedown-U" shape. Would you agree? Cheers, Peter "Ken Russell" wrote: -- Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... But then Ken, what reason would one have for writing: -x^2 if it really simplifies down to -x * -x = x^2? How would one write the opposite of the square of x? Cheers, Peter "Ken Russell" wrote: -3^2 is the same as -3*-3 which equals 9 not -9 At least that's what I was taught over 60 years ago. -- Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... I've recently noticed that Excel flies in the face of standard scientific, mathematical and engineering convention in the calculation of powers for numbers that are then multiplied by a negative. The convention of mathematics, "BIMDAS" (or similar acronyms), states that _I_ndices (or powers, or exponents), should be calculated before _M_ultiplication. Because of this, the following is accepted as correct: -3^2 = -9. This is because it is the equivalent of (-1) * 3^2 = -1 * 9 = -9 However, Excel chooses to recognise this as (-3)^2 = 9. This error is particularly problematic when doing algebraic computations in such a tool as Mathematica and then copying the result into Excel in input form. That is, -x^2 - -A1^2 - -A1^2 (Mathematica) (Mathematica with reference substituted) (Excel) To correct the error, one must manually change it to: -(A1^2) QUESTIONS 1: Why does Excel have this convention! 2: Is there any way to change it/make is more convenient? I've only recently noticed this (which is quite scary to think how many errors I may have made in the past!) Thanks for your time, Cheers, Peter |
#16
![]() |
|||
|
|||
![]()
I am a simple man who bows to your superior knowledge. At least all my
maths teachers are dead now :-) Cheers, Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... Doesn't -(x^2) satisfy -9? Yes, according to your convention, you would have to write -(x^2). So consider the two systems we could have: 1. x^2 the opposite of which is -x^2 2. x^2 the opposite of which is -(x^2) System number one (which, in my experience, is standard in maths, science and engineering textbooks) makes more sense to me. Indices or powers have precedence over multiplication. Consider graphs of parabolas. According to your definition, the graphs: y = x^2 AND y = -x^2 would be the same graph. However, in my experience, eveyone knows that y = x^2 is a "U" shape while y = -x^2 is an "upsidedown-U" shape. Would you agree? Cheers, Peter "Ken Russell" wrote: -- Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... But then Ken, what reason would one have for writing: -x^2 if it really simplifies down to -x * -x = x^2? How would one write the opposite of the square of x? Cheers, Peter "Ken Russell" wrote: -3^2 is the same as -3*-3 which equals 9 not -9 At least that's what I was taught over 60 years ago. -- Ken Russell Remove yourhat to reply by e-mail .. "Atreides" <atreides1AThotmailD0Tcom wrote in message ... I've recently noticed that Excel flies in the face of standard scientific, mathematical and engineering convention in the calculation of powers for numbers that are then multiplied by a negative. The convention of mathematics, "BIMDAS" (or similar acronyms), states that _I_ndices (or powers, or exponents), should be calculated before _M_ultiplication. Because of this, the following is accepted as correct: -3^2 = -9. This is because it is the equivalent of (-1) * 3^2 = -1 * 9 = -9 However, Excel chooses to recognise this as (-3)^2 = 9. This error is particularly problematic when doing algebraic computations in such a tool as Mathematica and then copying the result into Excel in input form. That is, -x^2 - -A1^2 - -A1^2 (Mathematica) (Mathematica with reference substituted) (Excel) To correct the error, one must manually change it to: -(A1^2) QUESTIONS 1: Why does Excel have this convention! 2: Is there any way to change it/make is more convenient? I've only recently noticed this (which is quite scary to think how many errors I may have made in the past!) Thanks for your time, Cheers, Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Maintaining a default worksheet order | Excel Discussion (Misc queries) | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
Data association | Excel Worksheet Functions | |||
time-clock calculation | Excel Worksheet Functions |