Home |
Search |
Today's Posts |
#81
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
In article ,
Dave Seaman wrote: By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Without a citation to "the definition" you're using, this is not persuasive. Your statement begs the question of operator precedence, and using it to argue for a particular order of precedence is therefore a tautology. |
#82
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
In article , "Harlan Grove"
wrote: PITA to use if you cling to any preconceived notions of left-to-right evaluation, but NEVER ambiguous. Yup - had to learn APL for my high school math classes. To be successful, it was hard to avoid learning the math, rather than just the formulae. |
#83
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"fred" wrote in message
... Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. Hmm, judging by the other posts, I seem to be the odd man out! When I went to (primary) school, -5 to the power of two = -5 * -5 = 25 -5 to the power of three = -5 * -5 * -5 = -125 ...and so on. The minus in "=0-5^2" is an operator, so zero less 5 to the power of two = -25. -- Mail sent to this email address is automatically deleted (unread) on the server. Send replies to the newsgroup. |
#84
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
On Tue, 03 Aug 2004 08:31:45 -0600, JE McGimpsey wrote:
In article , Dave Seaman wrote: By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Without a citation to "the definition" you're using, this is not persuasive. Your statement begs the question of operator precedence, and using it to argue for a particular order of precedence is therefore a tautology. Let A be a commutative ring with unity. Then A[X] is the ring of polynomials in X over A. It consists of all linear combinations of the primitive monomials, which have the form a * X^k for a in A and k in N. Thus, -X^2 is the primitive monomial (-1) * X^2, where -1 is the inverse of the identity 1 in A. Here I have followed the treatment in Lang, simplified by considering only the case of polynomials in a single symbol X rather than a set of symbols S. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/index.cfm?action=book&bookid=228 |
#85
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"fred" wrote in message ...
Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. Negation and subtraction are not the same thing. Subtraction has TWO operands. As I learned in second-grade math, minuend minus subtrahend equals difference. Perhaps that's not in the grade-school math books anymore. David Ames |
#86
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
Dave Seaman writes:
By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Begging the question. Phil -- 1st bug in MS win2k source code found after 20 minutes: scanline.cpp 2nd and 3rd bug found after 10 more minutes: gethost.c Both non-exploitable. (The 2nd/3rd ones might be, depending on the CRTL) |
#87
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
In article ,
Dave Seaman wrote: Let A be a commutative ring with unity. Then A[X] is the ring of polynomials in X over A. It consists of all linear combinations of the primitive monomials, which have the form a * X^k for a in A and k in N. Thus, -X^2 is the primitive monomial (-1) * X^2, where -1 is the inverse of the identity 1 in A. Here I have followed the treatment in Lang, simplified by considering only the case of polynomials in a single symbol X rather than a set of symbols S. Still a tautology...<g |
#88
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
================================================= "Negation" should be regarded as multiplication in the order-of-operation rules of arithmetic because, for all real x - x = (-1)x . Kevin O'Neill ================================================= "fred" wrote in message ... Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. "JE McGimpsey" wrote in message ... That's clearly explained in the XL Help topic "The order in which Microsoft Excel performs operations in formulas". In all the math I've ever done, from grade school on, negation and subtraction have been separate operations (often, but not always, using separate symbols, such as a hyphen for negation and an n-dash for subtraction), so that -5^2 has always been interpreted to equal 25. Personally, I'd take it up with your consultant, assuming that he/she was working on the Excel model. That problem should have been a piece of cake for someone with even moderate expertise to identify, from the sign change alone! There's no way you should have to pay for 20 hours of troubleshooting (at my rates, at least). In article , "fred" wrote: I did in another sub-thread. Dana was familiar with it already. If you lead off with a negative sign it uses the negative value inside the exponentiation. So, instead of =-5^2 equalling -25 it equals 25. but, =0-5^2 is calculated correctly as -25 even though it's mathematically the same. |
#89
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
================================================= No break is needed if the reason for the existence of order-of-operation rules is understood. Kevin O'Neill ================================================= "fred" wrote in message ... So if a physicist writes an equation he has to include the 'rules of calculation' for others to use it? Give me a break. "Dik T. Winter" wrote in message ... In article "fred" writes: Do any of you SCI.MATH whizes want to weigh in on this? Well, contrary to some responders I do not read this in an excel newsgroup (I have no reason to read such a newsgroup...). MS Excel calculates "=-5^2" as 25, not as -25. Yes, that is one of the possibilities. This is because 'negation' is handled first in Excel. (!?) Right, there are quite a few programming languages that do the same. If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Indeed. Is this in line with standard math rules? Yup, both are in line with standard math rules. There are no standard rules about how unary operators are handled. Is negation different than subtraction? Yes, indeed. I've had lots of math and as far as I know negation and subtraction are the same thing. When you look at the definition for rings, and stuff like that, you will find that they are very different. If you look you will find that a - b is just shorthand for a + b'. where b' is the negative of b. So 0 - 5^2 is shorthand for 0 + (5^2)' There are more places where some programming languages do not give you what you thought they should do. Exponentiaton is an example. What is: a ^ b ^ c? There is not strict left to right rule in mathematics... You may wonder, why should I do a - b + c from left to right? Well, actually you have to transform it to something that is basic mathematics: a + (-b) + c and now it does not matter what way you do the operations. where (5^2)' is the negative of 5^2. -- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131 home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/ |
#90
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
Plot the curve y = -x^2.
Solve the equation -x^2 -18x + 5 = 0. The standard normal density is f(x) = 1/sqrt(2 pi) exp(-x^2 / 2). What is the value of -16^(1/4)? The standard is not peculiar to those of us who are bemoaning the bug here. It is as universal as spelling rules. The only individuals claiming this to be an ambiguity appear to be computer professionals exclusively. There are thousands of end users of this product who are not programmers, nor should one need to be to use a spreadsheet. Nor should they be expected to comb the documentation to discover this peculiar "feature." This is a very flawed design. -- Stephen J. Herschkorn |
#91
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
On Tue, 03 Aug 2004 10:54:54 -0600, JE McGimpsey wrote:
In article , Dave Seaman wrote: Let A be a commutative ring with unity. Then A[X] is the ring of polynomials in X over A. It consists of all linear combinations of the primitive monomials, which have the form a * X^k for a in A and k in N. Thus, -X^2 is the primitive monomial (-1) * X^2, where -1 is the inverse of the identity 1 in A. Here I have followed the treatment in Lang, simplified by considering only the case of polynomials in a single symbol X rather than a set of symbols S. Still a tautology...<g You don't know what a tautology is. You asked for a citation. I provided one[1]. Moreover, the definition shows why polynomials are defined the way they are. They are linear combinations of the primitive monomials X^k. [1] Lang, _Algebra_, 1965. I haven't checked the later editions. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/index.cfm?action=book&bookid=228 |
#92
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
On 03 Aug 2004 19:31:00 +0300, Phil Carmody wrote:
Dave Seaman writes: By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Begging the question. See my followup elsewhere. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/index.cfm?action=book&bookid=228 |
#93
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
In article ,
"Stephen J. Herschkorn" wrote: The standard is not peculiar to those of us who are bemoaning the bug here. It is as universal as spelling rules. Repetition doesn't make it so... Nor is what you'd write by hand fundamentally relevant to using a spreadsheet, either. You didn't learn to add numbers using =SUM(A1:A10) in grade school. The only individuals claiming this to be an ambiguity appear to be computer professionals exclusively. Not me. I was trained as a chemist. There are thousands of end users of this product who are not programmers, nor should one need to be to use a spreadsheet. Absolutely correct. OTOH, they should be able to verify that they know how to use *any* tool before they rely on it. Nor should they be expected to comb the documentation to discover this peculiar "feature." What documentation does one need to enter =-5^2 into a cell to verify (or in this case, refute) one's assumption?!? This is a very flawed design. Perhaps (I could use it either way, but then I do check the documentation before I rely on the result), but it's been in existence for 20 years now. That makes it a *standard* for spreadsheets. It's not going to change. |
#94
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"fred" wrote in message .. .
BOULDERDASH!!! This is a horrible bug in Excel (whereof I was previously unaware). It is very standard that exponentiaion takes precedence over negation. Ask any semi-decent high school student to draw a graph of y = -x^2, and what will you get? Thank you sir! As another poster noted, M.P.E.P is a programming forum, but told that it violates math convention, they still argue. They probably just didn't believe me. Another said "much ado about nothing", but I think this is a horrible bug too. Excel should at least follow regular math conventions. What other surprizes await?! Wel, try this... Start up the Calculator that comes with WindowsXP. Enter the keystrokes: 2 + 3 * 5 = Try it in BOTH standard and scientific "Views" Compare, and reconcile, the answers. And don't forget, the programmers for Lotus 123 thought that 1900 was a leap-year |
#95
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
================================================= I've seen some high-level arguments including reference to algebraic structures (rings, groups, etc.) and "unary operations" in this and nearby threads that yield the correct result for the evaluation of an expression such as -3^2 (which is -9). The issue is far simpler than most other posts/responses seem to indicate: it comes from the order-of-operation rules of arithmetic, and "negation" should be regarded as multiplication under these rules because, for any real number x - x = (-1)x . Consequently, -3^2 = (-1)*3^2 = (-1)*9 = -9. The order-of-operation rules are sometimes seen as something cooked up by pedants. Anyone should consider reason for the existence of the rules by considering what values the following might assume when "simplified" if there were no rules. 2 + 3*4 (24 or 14 ?) 9 - 5 - 3 (1 or 7 ?) -3^2 (9 or -9 ?) Having the rules is better than needing to say, "Well . . . ya' know what I mean," frequently, and are far more important than most people realize -- they are how expressions (and consequently, equations) are read (and understood) even when the expressions contain variables. It is mildly interesting that some exceptions to the rules (specific cases in which the rules don't matter, e.g., a + b + c ) are listed among the field properties of the real numbers. It is truly unfortunate that ANY computer languages or programs would not conform to the order-of-operation rules. Kevin O'Neill ================================================= "Alan Beban" wrote in message ... Stephen J. Herschkorn wrote: fred wrote: Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. Alan Beban wrote: Well, this is an Excel forum, so one should expect a programming point of view. But if you search on mathematical notation generally, I think negation is viewed as a unary operator, while subtraction is viewed as a binary operator; and the discussions are not much clearer in that context. My own view, not as a mathematician, is that the issue revolving around how to evaluate -1^2 depends on some *order of precedence*, and is totally conventional as to negation and exponientation. BOULDERDASH!!! This is a horrible bug in Excel (whereof I was previously unaware). It is very standard that exponentiaion takes precedence over negation. Ask any semi-decent high school student to draw a graph of y = -x^2, and what will you get? Stating it is a documented convention is not a legitimate argument. What if Microsoft(R) buried in its documentation that addition takes precedence over multiplication? That the spell checker would always change word "friend" to "freind"? That the sum function adds only every other term? That using a "q" in one of its products would cause the system to reboot? These effects would be just as valid by this logic. I have sent this comment to Microsoft(R), though I expect no good to come of it. Pounding on the desk about it being "very standard that exponientation takes precedence over negation" is much less persuasive than would be citing the "standard" order of precedence rules applicable in mathematics. I don't find what "a semi-decent high school student" would do to be very compelling. Why can't the people who are so emotional about the issue (which, incidentally, seems to have been resolved in C the same way as it is in Excel, which is hard to blame Microsoft for) cite some persuasive authority besides the fact that their grandmother taught them to Please Excuse My Dear Aunt Sally, which my limited Google search suggests is applicable to only the binary operators listed and not to unary operators? Maybe we could all learn something if we were directed to an authoritative source of the convention in ordinary mathematics without regard to programming. Alan Beban |
#96
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
Stephen J. Herschkorn wrote:
Plot the curve y = -x^2. I can't until someone gives me the convention to determine whether it is to be interpreted as y=-(x)^2 or y=(-x)^2 Solve the equation -x^2 -18x + 5 = 0. I can't until someone gives me the convention to determine whether it is to be interpreted as -(x)^2 -18 + 5 = 0 or (-x)^2 -18x + 5 = 0 . . . What is the value of -16^(1/4)? I don't know until someone gives me the convention to determine whether it is to be interpreted as -(16)^(1/4)) or ((-16)^(1/4)) The standard is not peculiar to those of us who are bemoaning the bug here. It is as universal as spelling rules. Unless the inquiry gets sufficiantly sophisticated, I can usually resolve "spelling rules" by resort to a decent unabridged dictionary, like to resolve the correct spelling of "balderdash". If the order of precedence is so universal, please cite a "universal" authority (i.e., the analog of the unabridged dictionary for spelling). The only individuals claiming this to be an ambiguity appear to be computer professionals exclusively. I'm not a computer professional; in the absence of some persuasive authority, I find it ambiguous. Alan Beban |
#97
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Without a citation to "the definition" you're using, this is not persuasive. Your statement begs the question of operator precedence, and using it to argue for a particular order of precedence is therefore a tautology. Pick *any* algebra text, calculus text, etc. The expression -x^2 means the negative of x^2 throughout mathematics. If you want the negation to have priority, you write (-x)^2. For example, if you see the expression -x^2 +3x-2 in any math book, it means (-1)*x^2 +3*x -2 and is certainly not the same as x^2 +3x-2 (unless you are in a field of characteristic 2). This is absolutely standard notation. --Dan Grubb |
#98
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
=================================================
See my previous post(s). Kevin O'Neill ================================================= "Alan Beban" wrote in message ... Stephen J. Herschkorn wrote: Plot the curve y = -x^2. I can't until someone gives me the convention to determine whether it is to be interpreted as y=-(x)^2 or y=(-x)^2 Solve the equation -x^2 -18x + 5 = 0. I can't until someone gives me the convention to determine whether it is to be interpreted as -(x)^2 -18 + 5 = 0 or (-x)^2 -18x + 5 = 0 . . . What is the value of -16^(1/4)? I don't know until someone gives me the convention to determine whether it is to be interpreted as -(16)^(1/4)) or ((-16)^(1/4)) ~~~~~~~ SNIP Unless the inquiry gets sufficiantly sophisticated, I can usually resolve "spelling rules" by resort to a decent unabridged dictionary, like to resolve the correct spelling of "balderdash". If the order of precedence is so universal, please cite a "universal" authority (i.e., the analog of the unabridged dictionary for spelling). The only individuals claiming this to be an ambiguity appear to be computer professionals exclusively. I'm not a computer professional; in the absence of some persuasive authority, I find it ambiguous. Alan Beban |
#99
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
|
#100
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
==========================================
so that -5^2 has always been interpreted to equal 25. Absolutely not! ========================================== I've had lots of math and as far as I know negation and subtraction are the same thing. This statement is too vague to have meaning. Check posts from Kevin O'Neil for a simple explanation _______________________________________________ "fred" wrote in message ... Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. "JE McGimpsey" wrote in message ... That's clearly explained in the XL Help topic "The order in which Microsoft Excel performs operations in formulas". In all the math I've ever done, from grade school on, negation and subtraction have been separate operations (often, but not always, using separate symbols, such as a hyphen for negation and an n-dash for subtraction), so that -5^2 has always been interpreted to equal 25. Personally, I'd take it up with your consultant, assuming that he/she was working on the Excel model. That problem should have been a piece of cake for someone with even moderate expertise to identify, from the sign change alone! There's no way you should have to pay for 20 hours of troubleshooting (at my rates, at least). In article , "fred" wrote: I did in another sub-thread. Dana was familiar with it already. If you lead off with a negative sign it uses the negative value inside the exponentiation. So, instead of =-5^2 equalling -25 it equals 25. but, =0-5^2 is calculated correctly as -25 even though it's mathematically the same. |
#101
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Rainer Rosenthal" wrote in message ... "fred" wrote MS Excel calculates "=-5^2" as 25, not as -25. Is this in line with standard math rules? No. If all were OK, they'd call this program Excellent but since it lacks something it's just called Excel -- Rainer Rosenthal, _____________________ __________________________________________________ _________________________ @@ . . . . . . WHISTLE . . . . . . @@ Stick mit triangles, dudenkopf. Ari |
#102
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
BOULDERDASH!!! Is this a suburb of Boulder, Colorado? If not, it should be. This is a horrible bug in Excel Anyone with a modicum of literacy must agree. Ari __________________________________________________ _______ "Stephen J. Herschkorn" wrote in message ... fred wrote: Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. Alan Beban wrote: Well, this is an Excel forum, so one should expect a programming point of view. But if you search on mathematical notation generally, I think negation is viewed as a unary operator, while subtraction is viewed as a binary operator; and the discussions are not much clearer in that context. My own view, not as a mathematician, is that the issue revolving around how to evaluate -1^2 depends on some *order of precedence*, and is totally conventional as to negation and exponientation. draw a graph of y = -x^2, and what will you get? Stating it is a documented convention is not a legitimate argument. What if Microsoft(R) buried in its documentation that addition takes precedence over multiplication? That the spell checker would always change word "friend" to "freind"? That the sum function adds only every other term? That using a "q" in one of its products would cause the system to reboot? These effects would be just as valid by this logic. I have sent this comment to Microsoft(R), though I expect no good to come of it. -- Stephen J. Herschkorn |
#103
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Aristotle Polonium" wrote Stick mit triangles, dudenkopf. | ' . | | ' ' | | . ' | | | | \ / | PLONK! | -|- | | (_) | | A. P. | |__________| -- Rainer Rosenthal, _____________________ | _ | | | (_) | Given A, P and a circle. Find B, C on the | | A P | circle with P on BC and area(ABC)=maximum. | |__________|___(Ingmar Rubin in de.sci.mathematik) ________| |
#104
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
Alan Beban wrote:
Stephen J. Herschkorn wrote: Plot the curve y = -x^2. I can't until someone gives me the convention to determine whether it is to be interpreted as y=-(x)^2 or y=(-x)^2 Solve the equation -x^2 -18x + 5 = 0. I can't until someone gives me the convention to determine whether it is to be interpreted as -(x)^2 -18 + 5 = 0 or (-x)^2 -18x + 5 = 0 . . . What is the value of -16^(1/4)? I don't know until someone gives me the convention to determine whether it is to be interpreted as -(16)^(1/4)) or ((-16)^(1/4)) I suspect you are being highly disingenous here. Either that, or you must have had a terrible time getting through high-school level algebra. The onus is on *you* to provide one reputable source, outside of computer manuals, where these expressions are not interpreted as I have been maintaining. Interesting that you left ouf my example of the Gaussian (or error function). Have you *ever* seen it written with extra parentheses as in exp(-(t^2))? -- Stephen J. Herschkorn |
#105
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Stephen J. Herschkorn" wrote: fred wrote: Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. Alan Beban wrote: Well, this is an Excel forum, so one should expect a programming point of view. But if you search on mathematical notation generally, I think negation is viewed as a unary operator, while subtraction is viewed as a binary operator; and the discussions are not much clearer in that context. My own view, not as a mathematician, is that the issue revolving around how to evaluate -1^2 depends on some *order of precedence*, and is totally conventional as to negation and exponientation. BOULDERDASH!!! This is a horrible bug in Excel (whereof I was previously unaware). It is very standard that exponentiaion takes precedence over negation. Ask any semi-decent high school student to draw a graph of y = -x^2, and what will you get? Stating it is a documented convention is not a legitimate argument. What if Microsoft(R) buried in its documentation that addition takes precedence over multiplication? That the spell checker would always change word "friend" to "freind"? That the sum function adds only every other term? That using a "q" in one of its products would cause the system to reboot? These effects would be just as valid by this logic. I have sent this comment to Microsoft(R), though I expect no good to come of it. -- Stephen J. Herschkorn I real enjoy some of the funny answers to that bug (it is a well known one). What i enjoy most: some may never looked inside a Math text book. To keep it running: the following VBA code in Excel 2000 returns -4 as answer: Sub tst() MsgBox (-2 ^ 2) End Sub Which of course should be wrong if the spraed sheet answer is right. Or am i wrong? Or is every funny justification for that MS nonsense to be taken as a correct argument only if i do not want to apply it for the coding within Excel? Sorry for being childish. -- use mail not nonail for mail |
#106
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Jerry W. Lewis" wrote...
Harlan Grove wrote: "Jerry W. Lewis" wrote... .... . . . I do not have access to a version of Lotus, but I presume that they utilized the same order of operator precedence . . . And you'd be wrong! In 123, -3^2 returns -9. Interesting and surprising. Thanks for the information. Purely for the sake of argumentativeness, why surprising? It had to return -9 or +9, and given the precedence in most programming languages that provide both unary minus and exponentiation operators -9 would be more common. Indeed, in VBA -3^2 returns -9. Conformity with VisiCalc wasn't a good idea. VisiCalc was APL in reverse - all left to right evaluation. For example, 2*3^4 = (2*3)^4 rather than 2*(3^4), and 2+3*4 = (2+3)*4 rather than 2+(3*4). Just as in APL, and for the same reason, this is UNAMBIGUOUS. Counterintuitive, perhaps, but unambiguous. If Excel also enforced left to right evaluation with no operator precedence and only parentheses to change evaluation order, then Excel could claim consistency with VisiCalc, FWLIW. It doesn't, so Microsoft can't claim conformity with either VisiCalc or 123 to support their choice of operator precedence. They came up with this all on their own. That Lotus chose to have 123 behave differently than VisiCalc was a good thing, IMO. OTOH, Microsoft Excel is aking to COBOL rather than FORTRAN. How nice! That said, at least in the context of programming languages, in which various spreadsheets' formulas are functional languages, there's no consistent convention for operator precedence. Whether or not this is/was a mistake is irrelevant to the extent that changing it would be worse. In any case, this is *not* a bug in Excel, it's a feature arising from a possibly obtuse design decision. So far 4 different parsing approaches in spreadsheets and programming languages have been described: APL's no precedence, strict right to left; VisiCalc's no precedence, strict left to right; the mainstream's (123, FORTRAN, BASIC including VBA, Perl, Python, etc.) exponentiation taking higher precedence than negation; and the fringe's (Excel, COBOL, apparently AppleScript, REXX and a few others) negation taking higher precedence than exponentiation. At the very least, no matter what may be correct in textbooks, there's ample variety in programming languages, so anyone attempting to use any programming language to perform calculations on a digital computer had better check their programming language's operator precedence. Bitching, whining and moaning about how this is wrong, wrong, terribly wrong is wasted time, breath and effort. |
#107
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
Phil Carmody wrote...
.... He probably means that unary minus has a significantly higher precedence than subtraction, so much so that it has a strictly higher precedence than at least one operator that one would commonly view as being of a strictly higher precdence than subtraction. No kidding! Gee, I'd never have guessed. How odd that this makes C just like FORTRAN. I've been involved in a few back & forth discussions with Alan, and I have little doubt he misconstrued C's ^ operator. FWLIW, the precedence of unary minus/negation and multiplication, division and remainder operators just doesn't matter. Considering C's *, (a * b) == (-a) * (-b) == -(a * (-b)) (-a * b) == (-a) * b == -(a * b) (a * -b) == a * (-b) [b's - can't be parsed otherwise] (-a * -b) == (-a) * (-b) == (-a * (-b)) == -(a * (-b)) Unary minus *could* have been given equal to or lower precedence than *, / and %, and it wouldn't have mattered. I suspect the reason it's higher is that it was supposed to be given the same as -- and ++, and those are given higher precedence than *, / and %. Much, much easier giving all unary operators the same precedence, so they'd be resolved by the associativity rule alone. Therefore there is a concrete example of an expression which is interpretted differently in C than it would be using people like you's conventions. First, what are my conventions? Second, if my favored conventions exactly matched those of Excel, how would that matter vis-a-vis negation/unary minus and *, / or %? While the machine may mechanically parse unary minus earlier than *, / or %, the results would be the same if it parsed unary minus after. In C's case, the precedence inversion is with the multiplicative family of operators. e.g. compare C's interpretation of -2%3 as (-2)%3 rather than -(2%3). OK, it matters for remainder, but because there's residual ambiguity about what (-2) % 3 should return. Is the answer -2 or +1? This is also a matter of convention, and there are differences of opinion. FWIW, C and Excel differ here, but it's due to the sign convention of the remainder operator, not to operator precedence. In C, -2 % 3 == (-2) % 3 == -(2 % 3) == -2, but in Excel MOD(-2,3) == 1 != or < -MOD(2,3) == -2. Note that because Excel uses a function for remainder, unary minus's operator precedence is immaterial; the signs of both arguments to the remainder function are necessarily obvious. |
#108
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
Stephen J. Herschkorn wrote:
I suspect you are being highly disingenous here. Either that, or you must have had a terrible time getting through high-school level algebra. The onus is on *you* to provide one reputable source, outside of computer manuals, where these expressions are not interpreted as I have been maintaining. Whether I am being highly disingenuous and whether I had difficulty with high-school level algebra are irrelevant. It seems to me self-evident (accepting that ^2 is equivalent to a superscript 2) that -x^2, without an adopted convention as to the order of precedence between negation and exponentiation, can as readily be interpreted as -(x^2) or (-x)^2; that is, without an adopted convention, it is ambiguous. I'm simply asking for a citation to the order of preference convention that you have indicated is universally accepted (outside of computer programming). Unless you are claiming that its acceptance is (and always has been?) so universal that it has never been authoritatively declared--even in textbooks purporting to be the basis for teaching unfamiliar students the fundamentals of the language to be used in high-school algebra. Onus or not, I just find it odd that a thread can have gone on this long with noone citing a source for a universally accepted convention, other than assertions about broad usage. In short, where can one learn about the order of precedence of negation and exponentiation in mathematics without having to read a slew of algebra books to measure up common usage. Alan Beban |
#109
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
On Tue, 03 Aug 2004 14:26:52 -0700, Alan Beban wrote:
Stephen J. Herschkorn wrote: I'm simply asking for a citation to the order of preference convention that you have indicated is universally accepted (outside of computer programming). Unless you are claiming that its acceptance is (and always has been?) so universal that it has never been authoritatively declared--even in textbooks purporting to be the basis for teaching unfamiliar students the fundamentals of the language to be used in high-school algebra. Onus or not, I just find it odd that a thread can have gone on this long with noone citing a source for a universally accepted convention, other than assertions about broad usage. In short, where can one learn about the order of precedence of negation and exponentiation in mathematics without having to read a slew of algebra books to measure up common usage. You evidently have not read my post in which I cited Lang on the definition of polynomial rings. You have seen a wealth of examples demonstrating that -x^2 is universally understood to mean -(x^2), ranging from the application of the quadratic formula to the definition of the normal density function, to the formulas used for differentiation and antidifferentiation of polynomials. There has been no evidence of a single example in any math book demonstrating the opposite convention, despite repeated challenges to produce such an example. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/index.cfm?action=book&bookid=228 |
#110
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
VB/VBA/Basic - different product, different rules. VBA works with Excel as it works with other software packages. There are many diffences in how they parse and interpret. To ensure the highest probability of success, one must learn the rules employed. When advertised behavior doesn't match assumed behavior, then who is to blame? Personally, when I want to depend on some type of implicit behavior, I either test it or consult the documentation (and then test it to see if I understood it correctly). -- Regards, Tom Ogilvy "Axel Vogt" wrote in message ... "Stephen J. Herschkorn" wrote: fred wrote: Do any of you SCI.MATH whizes want to weigh in on this? MS Excel calculates "=-5^2" as 25, not as -25. This is because 'negation' is handled first in Excel. (!?) If you put a zero in the equation, as in "=0-5^2", your answer changes to -25. Is this in line with standard math rules? Is negation different than subtraction? I'm getting a lot of comments in the Excel NG basically saying that "it's in the help section, so too bad". I've had lots of math and as far as I know negation and subtraction are the same thing. Alan Beban wrote: Well, this is an Excel forum, so one should expect a programming point of view. But if you search on mathematical notation generally, I think negation is viewed as a unary operator, while subtraction is viewed as a binary operator; and the discussions are not much clearer in that context. My own view, not as a mathematician, is that the issue revolving around how to evaluate -1^2 depends on some *order of precedence*, and is totally conventional as to negation and exponientation. BOULDERDASH!!! This is a horrible bug in Excel (whereof I was previously unaware). It is very standard that exponentiaion takes precedence over negation. Ask any semi-decent high school student to draw a graph of y = -x^2, and what will you get? Stating it is a documented convention is not a legitimate argument. What if Microsoft(R) buried in its documentation that addition takes precedence over multiplication? That the spell checker would always change word "friend" to "freind"? That the sum function adds only every other term? That using a "q" in one of its products would cause the system to reboot? These effects would be just as valid by this logic. I have sent this comment to Microsoft(R), though I expect no good to come of it. -- Stephen J. Herschkorn I real enjoy some of the funny answers to that bug (it is a well known one). What i enjoy most: some may never looked inside a Math text book. To keep it running: the following VBA code in Excel 2000 returns -4 as answer: Sub tst() MsgBox (-2 ^ 2) End Sub Which of course should be wrong if the spraed sheet answer is right. Or am i wrong? Or is every funny justification for that MS nonsense to be taken as a correct argument only if i do not want to apply it for the coding within Excel? Sorry for being childish. -- use mail not nonail for mail |
#111
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"JE McGimpsey" wrote in message ... In article , "Stephen J. Herschkorn" wrote: Ask any semi-decent high school student to draw a graph of y = -x^2, and what will you get? If you asked someone competent, not just semi-decent, from my high school, or college, or graduate school, you'd get the same curve as y = x^2 I doubt that any U.S school, including yours, teaches a different convention than that -z is the negation of z. With z=x^2 you have -x^2 is the negation of x^2. Perhaps you were thinking in terms of a plotting sequence: y = -x plot(y^2) which indeed would plot a positive curve, because it is plotting (-x)^2, which is NOT the same as -x^2. KeithK but it's a convention, not a law, so it wouldn't be surprising to see the negation of y = x^2 The flaw is in assuming that you have a lock on absolute truth, rather than recognizing that when there's ambiguity you need context. There's no ambiguity that negation and subtraction are different. The fact that the typography is ambiguous means that you need to check your assumptions. Those who insist that a computer application must conform to *their* standard have never programmed in APL. |
#112
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
In article <sYTPc.1888$Uh.1172@fed1read02, "KeithK"
wrote: I doubt that any U.S school, including yours, teaches a different convention -z is the negation of z. Of course not. Nobody is disputing that... With z=x^2 you have -x^2 is the negation of x^2 And of course you know that the second statement doesn't logically follow from the first. Nor is it logically incorrect. It's simply an assertion. Doubt if you must, but the US high school I attended used the opposite to the supposedly "universal" convention (though it was certainly discussed as a convention, not "the universal truth", and I'm fluid enough to accommodate whichever convention(s) are being used). Since a significant portion of the curriculum for the Calc and DiffEQ courses (algebra was 7th grade) included daily exercises on the material using APL (as did my college math courses), that was, perhaps, a natural consequence. It certainly emphasized the difference between negation and subtraction, and the *formality* of order of precedence was made more salient. Typographically, the negation operator in our textbooks was different than the subtraction operator, and parentheses were used when needed. I no longer know what curriculum is used at that school, of course, though at least one of the faculty members that taught me is still there. Might be diverting to give her a call... |
#113
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Math Bug
Stephen J. Herschkorn wrote:
as a follow up to Alan Beban's previous post, snippet: SH Plot the curve y = -x^2. AB I can't until someone gives me the convention to determine whether it is to be interpreted as y=-(x)^2 or y=(-x)^2 I suspect you are being highly disingenous here. Either that, or you must have had a terrible time getting through high-school level algebra. The onus is on *you* to provide one reputable source, outside of computer manuals, where these expressions are not interpreted as I have been maintaining. If you'll forgive me, and in the nicest way, you give the impression of an academic stuck in narrow confinement. You previously cited convention or notation that is in the ever on going process of evolution. For readability, brevity and generally understood it has until recently served its purpose well. But a convention nonetheless, and potentially ambiguous. Alan's point is pertinent and helpful, you (and Dave Seaman nearby) have missed it. The onus is not on him to "to provide one reputable source", you may well be correct that such does not exist. Surely, the point is that the onus is on the user of a chosen app to explicitly conform to "its" convention. If you don't like it don't "chose" to use it. I would be very surprised if there are any of today's maths students unaware of such requirement, particularly with something as ubiquitous as Excel. My school days were long before the aid of a chip. Fortunately I was taught to think like this: +(+1) -(+1) +(-1) 1-1-1 is an abbreviation, partial evaluation or conventional notation of the above, depending on your point of view. BTW, to conform with "another" Excel convention you need to append the shorter version with an "=" before entering into a cell. Optionally you may elect to switch to a Lotus convention. It's one of those need to know things. Regards, Peter PS, in another post Fred wrote along the lines that negation and subtraction are the same. Maybe you can correct me but I was taught negation may be considered as A x (-1) or, a double subtraction of itself as in A - A - A |
#114
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Harlan Grove" wrote
in VBA -3^2 returns -9. I agree with your attitude as stated below, but it sure seems like an inconsistency when "Cells(1,1)=-3^2" in an Excel macro (VBA) makes the cell-value -9, while typing "=-3^2" in the cell makes the cell-value 9. It's the seeming *inconsistency* that's the problem. At the very least, no matter what may be correct in textbooks, there's ample variety in programming languages, so anyone attempting to use any programming language to perform calculations on a digital computer had better check their programming language's operator precedence. Bitching, whining and moaning about how this is wrong, wrong, terribly wrong is wasted time, breath and effort. --r.e.s. |
#115
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
In article "Stephen J. Herschkorn" writes:
What is the value of -16^(1/4)? The standard is not peculiar to those of us who are bemoaning the bug here. It is as universal as spelling rules. Perhaps, but it is spelled out nearly nowhere. Certainly not at school. The only individuals claiming this to be an ambiguity appear to be computer professionals exclusively. So what? There are thousands of end users of this product who are not programmers, nor should one need to be to use a spreadsheet. Nor should they be expected to comb the documentation to discover this peculiar "feature." This is a very flawed design. Would you care to pay a penny for each user that thinks "1 + 2 * 3 = 9"? I have even seen professional physicians make that error (they enter it as such on their calculator and get that answer). Mathematics does not dictate that '*' precedes '+'; that is only convention. A convention that is (alas) not spelled out in most books. The Dutch saying for the convention is "Meneer Van Dale Wacht Op Antwoord" implying the following order: 1. M Machtsverheffen = powering 2. V Vermenigvuldiging = multiplication 3. D Deling = division 4. O Optellen = addition 5. A Aftrekken = subtraction. Using that rule there are quite a few people that thing that 8 - 3 + 4 = 1 Can you understand why? -- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131 home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/ |
#116
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"r.e.s." wrote...
.... I agree with your attitude as stated below, but it sure seems like an inconsistency when "Cells(1,1)=-3^2" in an Excel macro (VBA) makes the cell-value -9, while typing "=-3^2" in the cell makes the cell-value 9. It's the seeming *inconsistency* that's the problem. Agreed, it's a problem. However, it was unavoidable. BASIC existed long before any spreadsheet, and BASIC had established operator precedence (mainstream). Excel existed before VBA, a dialect of BASIC, was grafted onto it, and the nice people at Microsoft made a bad (but irrevocable in practical terms) design decision about operator precedence. (Does anyone know how Multiplan handled -3^2?) When the two, Excel and VBA, were merged, the inconsistency became truly exquisite. Excel also uses a sign convention in its financial functions, something none of the non-Excel clone spreadsheets (so few these days) do or did. Indeed, there are a lot of questionable design decisions in Excel, but at this point in time you have to live with them or use something else. Posted Via Nuthinbutnews.Com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.nuthinbutnews.com |
#117
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
JE McGimpsey wrote in message ...
In article , Dave Seaman wrote: By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Without a citation to "the definition" you're using, this is not persuasive. Your statement begs the question of operator precedence, and using it to argue for a particular order of precedence is therefore a tautology. Any introductory course on abstract algebra. -x is the additive inverse of x: the number such that x + (-x) = 0. 'cid 'ooh |
#118
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Harlan Grove" wrote in message ...
"Dik T. Winter" wrote... ... When you look at the definition for rings, and stuff like that, you will find that they are very different. If you look you will find that a - b is just shorthand for a + b'. where b' is the negative of b. So 0 - 5^2 is shorthand for 0 + (5^2)' ... I don't recall exponentiation being covered in the development of either rings or fields. Just addition and multiplication and their respective inverses. Exponentiation wasn't brought up until polynomials were introduced. Didn't you cover group theory? Exponential notation is quite common for multiplicative groups, and multiplicative notation is quite common in additive groups. Example: In (Z_7, +), x + x defines 2x, x + x + x defines 3x, etc. In (Z_7, *), x*x defines x^2, x*x*x defines x^3, etc. That's how you're justified to use things like the least integer property and modular arithmetic when working with abstract groups. 'cid 'ooh |
#119
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Acid Pooh" wrote in message
om... JE McGimpsey wrote in message ... In article , Dave Seaman wrote: By the definition of unary minus, -x^2 is the number such that x^2 + (-x^2) = 0. Without a citation to "the definition" you're using, this is not persuasive. Your statement begs the question of operator precedence, and using it to argue for a particular order of precedence is therefore a tautology. Any introductory course on abstract algebra. -x is the additive inverse of x: the number such that x + (-x) = 0. 'cid 'ooh I do believe that most posters in this thread know that. However, while the meaning of -x may be clear, the meaning of -x^2 is not. -- Vasant |
#120
Posted to microsoft.public.excel.programming,sci.math
|
|||
|
|||
Excel Math Bug
"Kevin O'Neill" wrote...
.... The issue is far simpler than most other posts/responses seem to indicate: it comes from the order-of-operation rules of arithmetic, and "negation" should be regarded as multiplication under these rules because, for any real number x - x = (-1)x . .... True, but also - x = 0 - x. Which is the one to use? It is truly unfortunate that ANY computer languages or programs would not conform to the order-of-operation rules. Agreed, but more than a few don't. As stated elsewhere in this thread, VisiCalc, the first widely used spreadsheet, used simple left-to-right evaluation with no operator precedence. APL, on the other hand, uses simple right-to-left evaluation with no operator precedence. COBOL and it seems also REXX in addition to Excel use standard operator associativity and operator precedence *except* for negation having higher precedence than exponentiation. Finally, there are the mainstream languages that adopted, to the extent possible, standard math/science textbook operator precedence. It's unfortunate COBOL, REXX and Excel do this, but they do exist and they can't be changed without breaking existing applications. Also, the existence of at least 4 different arithmetic evaluation procedures in programming languages (broadly defined to include spreadsheets as a functional variety) should give pause to anyone attempting to use any of them to program. When programming computers, know your tools. Is there any reason why it works this way? What I figure is that someone a long time ago (maybe the COBOL designers) saw -3 ** 2 or something similar in FORTRAN and decided that this 'naturally' read as negative three (as a term in and of itself) raised to the second power. They generalized from this, and -x ** 2 would be negative x (also as a term in and of itself) raised to the second power. It may go counter to textbook convention, but from the point of view of nonmathematicians it's not a completely unreasonable approach. Posted Via Nuthinbutnews.Com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.nuthinbutnews.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Less Excel more Math | Excel Worksheet Functions | |||
Math functions in Excel | Excel Discussion (Misc queries) | |||
Excel math formula | Excel Worksheet Functions | |||
How do I ? math/excel question | Excel Discussion (Misc queries) | |||
More math than excel, but a fun problem | Excel Worksheet Functions |