Problem description: the exponent is applied both to the base and to the leading sign Steps to reproduce: write in a cell =-1^2 should be considered as =-(1^2) NOT as =(-1)^2 so the current result is 1 instead of -1 Platform (if different from the browser): Browser: Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0
the priority of unary operators is higher then binary operators. From there, the result is correct
*** Bug 48470 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > the priority of unary operators is higher then binary operators. From there, > the result is correct (In reply to comment #1) > the priority of unary operators is higher then binary operators. From there, > the result is correct -3^2=-9 because operator ^ has higher precedence than - Mathematica, Matlab, Matcad, Derive,Maxima,Scilab,Freemat,Octave,Lotus,VB.NET gives -9 too. For +9, it should be written as: (-3)^2. when -3^2=9 then: 3^2-3^2=0 and -3^2+3^2=18 ?? see too links: http://www.wolframalpha.com/input/?i=2%5E3%5E2 http://www.wolframalpha.com/input/?i=-3%5E2
in a general purpose program a "-" sign should be considered a minus sign, not an unary operator : at school everyone is taught that ^ has the priority on a sign, only a few of these learn about existence of unary operators later on. Most people won't understand or expect that ^ has the priority on *,/ and + but not on -, it is very insidious.