[Patches] [ python-Patches-440487 ] int to the negative power -> float
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 11 Jul 2001 12:52:04 -0700
Patches item #440487, was opened at 2001-07-11 12:27
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=440487&group_id=5470
Category: core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
>Assigned to: Tim Peters (tim_one)
Summary: int to the negative power -> float
Initial Comment:
Currently, int to the negative int power raises an
exception.
This was one of the two problems that the VPython users
complained about. (The other was that integer division
returns a truncated integer, but that's another story.
:-)
I propose to implement this in Python 2.2. Anybody
have a problem with this?
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-07-11 12:52
Message:
Logged In: YES
user_id=6380
Tough luck. :-)
There may be something else wrong with the patch: it
probably shouldn't fall back to float when z is not None.
After all, pow(x, y, z) should compute x**y % z, and I'm
sure that someone using this would be quite surprised to get
a floating point number back if they accidentally let y
become negative!
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2001-07-11 12:46
Message:
Logged In: YES
user_id=31435
No objection so far as it goes, but surely long_pow()
should also attempt the same kind of thing then. Should
add some test cases and docs too (yes, I'm going to hold
you to the same stds as contributors <wink>).
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=440487&group_id=5470