What does $-2^2$ evaluate to? My wife is upgrading her math & I'm quite uncertain how to answer.

is it the same as $(-2)^2$ or is it the same as $-(2^2)$?

at the heart of this is whether the minus sign is associated with the 2 or the expression $2^2$.

thank you! mp

  • $\begingroup$ $-2^3 = -(2^3)$ $\endgroup$ Sep 30, 2011 at 18:15
  • 1
    $\begingroup$ The usual convention is that exponentiation occurs first, multiplication by constants and negative signs occur later. If you are following the usual conventions, then $-2^2$ would be interpreted as "do $2^2$ first, then multiply the answer by $-1$", to get $-4$. However, this is a convention. In some contexts, it might have been agreed that $-2^2$ means $(-2)^2$. $\endgroup$ Sep 30, 2011 at 18:18
  • $\begingroup$ thank you TheChaz--corrected the title. thank you arturo for setting the super script...didn't see how to do that. your reply is consistant with the book's chapter..."orders of operation". thank you all. $\endgroup$
    – x-ray
    Sep 30, 2011 at 18:22

1 Answer 1


There are different conventions. In mathematics the usual one is to write $(-2)^2$ if you want to raise a negative number to a power, whereas $-2^2$ usually means $-(2^2)$.

This is, however, not completely universal. For example, many programming languages (that otherwise follow mathematical conventions for arithmetic expressions) consider a unary minus to bind tighter than any binary operator. In such languages, -2**2 (or whatever their syntax for exponentation is) would mean (-2)**2.

In the end you may be better off checking both interpretations and see which of them makes sense in context. And when writing things yourself, if in doubt err on the side of too many parentheses.

  • 4
    $\begingroup$ I think the convention is universal in mathematics, if not within programming languages. I normally either comment or deduct points, saying it's incorrect, if I'm grading something where a student wrote $-2^2$ while clearly intending $(-2)^2$ or where $(-2)^2$ is correct. $\endgroup$ Sep 30, 2011 at 19:12
  • 1
    $\begingroup$ Apparently, Microsoft Excel follows the other convention support.microsoft.com/kb/q132686 :) $\endgroup$
    – Srivatsan
    Sep 30, 2011 at 20:49
  • $\begingroup$ @Henning: Do you know of any particular examples of a programming language that chooses the opposite convention? $\endgroup$
    – user14972
    Sep 30, 2011 at 22:27
  • $\begingroup$ Actually, the C-based languages do not have an exponentiation operator, but use functions instead, so there would be no ambiguity. Fortran uses ** but it places that ahead of negation in precedence, and I would imagine that other languages styled after Fortran use the same precedence. $\endgroup$ Oct 1, 2011 at 3:59
  • $\begingroup$ python reports $-2**2 == -4$ as well, and I'm virtually certain magma and mathematica agree. Since you've mentioned fortran, that completely exhausts the languages I have at least passing familiarity with that I know have a binary exponentiation operator. $\endgroup$
    – user14972
    Oct 1, 2011 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.