Precidence of unary plus/minus relative to exponentiation
FBatista at uniFON.com.ar
Tue Apr 1 21:54:56 CEST 2003
#- >>> -2.0**2.0
#- Python's operator predicence is causing this to be interpreted as:
#- >>> -(2.0**2.0)
It's OK, because the minus and the plus are the last verified signs, in
Python and everywhere else, as far I know.
#- rather than the normal mathematical precidence, which would give
#- >>> (-2.0)**2.0
No, no, no. In "everyday math" if you want to elevate the -2 to 2, you need
to put the brackets explicitly.
More information about the Python-list