-a2 is taken to mean -(a2) = -a2 by most pieces of technical software because raising to a power takes precedence over negation.
Not all technical software adopts this convention. Microsoft Excel, for example, takes the opposite view and sets -a2 = a2
(which means that it calculates -12 = 1, but also calculates 0-12 = -1)
You should check what convention is adopted by whatever calculator/software you are using.