[New-bugs-announce] [issue6781] even exponentiation of negative numbers

benlbroussard report at bugs.python.org
Tue Aug 25 14:29:25 CEST 2009

New submission from benlbroussard <benlbroussard at gmail.com>:

Negative one squared should be one, but is negative one sometimes.

pow(-1, 2) = 1
-1 ** 2 = -1
-1 ^ 2 = -1

The ** and ^ operators aren't working like expected, and the pow()
documentation is incorrect since it says "The two-argument form pow(x,
y) is equivalent to using the power operator: x**y."

components: None
messages: 91951
nosy: benlbroussard
severity: normal
status: open
title: even exponentiation of negative numbers
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list