Thursday, June 27, 2013

Power of negative number - pari gp

Do use parentheses () to wrap your negative where necessary.






Because exponentiation has priority over +/- you should wrap your -1 in parentheses (), or, if just squaring, use the sqr() function.

The priority of operators in Pari/GP is detailed in Section 2.4 of the User Guide and titled "2.4 GP Operators"