Parentheses are used to change the order of operation. In this case, it is necessary to let the program know you want the order of operation to be different from that which it uses as a default. Yes, I know you already know that. I'm just clarifying as you seem to have done with previous statement. That is why I said that in cases where a mathematical operation is "ambiguous" (by this if you read the context, I'm talking about where order of operations is in question), it can and will prevent issues. It is true that you don't have to add them all over the place, but they are needed at certain times.

In this case, the "correct" order of operation without parentheses would be 2^2 * -1 = -4. A minus operation whether by negative sign or by an actual minus is done after powers. In fact, multiplication and division (both of which are done before any minus/negative operation) is done after exponents.

2*2^3 = 16 if you don't use parentheses

If you wanted 4^3, you have to use parentheses just has you would with -2^2 (aka -1*2^2).


Invision Support
#Invision on irc.irchighway.net