On Thursday 08 May 2008 06:54:42 pm wxPythoner@gmai l.com wrote:
Actually, I've always written it as (-123)**0. At least where I'm from,
exponentiation takes precedence even over unary "-". (to get a power of -123,
you must write $(-123)^0$ [latex])
Though not an authoritative source, wikipedia also uses the (-x)^y notation:
Btw, there seems to be a math problem in python with exponentiation. ..
1
That 0^0 should be a nan or exception, I guess, but not 1.
[just found out while trying the poster's example]
--
Luis Zarrabeitia (aka Kyrie)
Fac. de Matemática y Computación, UH.
The problem is that Python parses -123**0 as -(123**0), not as
(-123)**0.
(-123)**0.
exponentiation takes precedence even over unary "-". (to get a power of -123,
you must write $(-123)^0$ [latex])
Though not an authoritative source, wikipedia also uses the (-x)^y notation:
Btw, there seems to be a math problem in python with exponentiation. ..
>>0**0
That 0^0 should be a nan or exception, I guess, but not 1.
[just found out while trying the poster's example]
--
Luis Zarrabeitia (aka Kyrie)
Fac. de Matemática y Computación, UH.
Comment