[New-bugs-announce] [issue8353] Negative exponentiation behaving oddly in python shell

Chris Ward report at bugs.python.org
Fri Apr 9 07:57:25 CEST 2010

New submission from Chris Ward <cwardusc at gmail.com>:

When using exponentiation interactively in the python shell, it returns all negative results when a negative number is the input. For example:

-4 ** 2 will return -16
-4 ** 2 should evaluate as -4 * -4, which correctly returns 16

This does not occur when using the 'Run Module' feature of IDLE and the exponentiation is processed from the module, it only seems to occur when directly typed into the interactive prompt. I couldn't find anything to suggest this is expected behavior. Using pow() from the prompt returns the correct result, so it only happens in this one situation. Obviously this is low priority since it only affects the prompt and there's a working alternative, but I figured I'd report it anyways. :)

components: IDLE
messages: 102681
nosy: CWardUSC
severity: normal
status: open
title: Negative exponentiation behaving oddly in python shell
type: behavior
versions: Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list