Why is the result of $-2^2 = -4$ but $(-2)^2 =4$? I am really new into math, why is $-2^2 = -4 $ and $(-2)^2 = 4 $? 

Universally, exponentiation is agreed to be evaluated before subtraction.
However, there are two opposing wishes that go into the design of a grammar:


*

*Negation is evaluated at the same time as subtraction, to avoid irregularities

*Unary operators are all evaluated before binary operators, to keep things simple


In the first case, $-2^2 = -4$.  In the second case, $-2^2 = 4$.  Most mathematical publications and mathematics forums will use the first case.  However, some software (I believe Haskell like grammars are an example) use the second case.
