Bizarre arithmetic results

Jussi Piitulainen jpiitula at ling.helsinki.fi
Thu Feb 11 11:23:38 EST 2010


Robert Kern writes:
> On 2010-02-11 06:31 AM, Shashwat Anand wrote:
> > There is a little issue here that '>>> -.1 ** .1' should give you
> > error message. That is it.
> 
> No, fractional powers of negative numbers are perfectly valid
> mathematically. The result is a complex number. In Python 3 (what
> the OP is using), this has been implemented, but not in Python 2.6.

Perhaps it should raise a MisleadingSpacingError at compile time. The
error message could recommend - .1**.1, or better -(.1 ** .1).



More information about the Python-list mailing list