# what does $-2^2$ evaluate to?

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

• $-2^3 = -(2^3)$ Sep 30 '11 at 18:15
• 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$. Sep 30 '11 at 18:18
• 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. Sep 30 '11 at 18:22

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.

• 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. Sep 30 '11 at 19:12
• Apparently, Microsoft Excel follows the other convention support.microsoft.com/kb/q132686 :) Sep 30 '11 at 20:49
• @Henning: Do you know of any particular examples of a programming language that chooses the opposite convention?
– user14972
Sep 30 '11 at 22:27
• 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. Oct 1 '11 at 3:59
• 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.
– user14972
Oct 1 '11 at 16:36
{"ft_lang_label":"__label__en","ft_lang_prob":0.89279413,"math_prob":0.9548102,"size":687,"snap":"2021-31-2021-39","text_gpt3_token_len":149,"char_repetition_ratio":0.0761347,"word_repetition_ratio":0.0,"special_character_ratio":0.23289666,"punctuation_ratio":0.10236221,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99544567,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-19T13:36:27Z\",\"WARC-Record-ID\":\"<urn:uuid:d7dc4279-6992-45bb-9eb2-257e7ba97cdd>\",\"Content-Length\":\"175235\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a1de5fdf-fd9f-4a40-b009-16c357026efb>\",\"WARC-Concurrent-To\":\"<urn:uuid:8f0edd2e-5157-4203-9c96-d359c9de0224>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/68833/what-does-22-evaluate-to/68834\",\"WARC-Payload-Digest\":\"sha1:ARVOIOS6QJUJHTRSFXLN33OXZKQW5SVV\",\"WARC-Block-Digest\":\"sha1:UNF6LNQRKRUL3MRUHWPZJVSYRIMJSXRM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780056890.28_warc_CC-MAIN-20210919125659-20210919155659-00551.warc.gz\"}"}