>I believe that unary negation has a lower precedence than exponentiation. I think it is included in the rules for binary operations so it is not spelled out in PEMDAS.
>
>I don't think we can go by any programming language's rules of precendence because each language determines its own and it doesn't always match that of math .
I think so it's a bug.
>
>For example, -4^2 = -(4^2) = -16
NOT (-4)^2 = 16
>
>That's from my daughter's math worksheets :o) So, if it is wrong, blame her teacher or the math books her teacher used :o)
I asked a
mathematic engineer. Her teacher should be wrong. But I think so math books her teacher used don't wrong. Maybe her teacher careless about that.
Try this link too
http://www.online-utility.org/math/math_calculator.jspMicrosoft accept that's an "unexpected positive number":
http://support.microsoft.com/kb/q132686/>
>
>>Alan,
>>
>>Unary negation does have higher precedence than exponentiation! It also represents a subtraction from 0.
>>
>>You can't believe everything you read on the internet.
>>
>>>No David. In normal math, the unary operator does not have precedence because it actually represents a multiplication by -1. In other words, -2**2 is the same as saying -1*2**2 and since exponentiation takes precedence over multiplication, the correct answer is -4. For the record, I thought it was 4 at first too.
>>>
>>>Check this out:
http://mathforum.org/library/drmath/view/69058.html