This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, skrah
Date 2009-10-04.09:41:15
SpamBayes Score 2.4477087e-12
Marked as misclassified No
Message-id <1254649277.88.0.0533999761459.issue7049@psf.upfronthosting.co.za>
In-reply-to
Content
Shrug.  That doesn't really bother me.  x**y%z and pow(x, y, z) aren't 
going to match anyway, as soon as x**y has to be rounded.

What would bother me more is the idea of having, with precision 4:

pow(3, 22, 12347) -> nan
pow(3, 23, 12347) -> 7820
pow(3, 24, 12347) -> nan
pow(3, 25, 12347) -> 8645
pow(3, 26, 12347) -> 1241
etc.

(or a similar phenomenon with the 1st argument varying and 2nd and 3rd 
arguments fixed).  Or something that called pow(x, 3, 100003) with 
precision 5, and worked for all but 3 possible values of x.  That sort 
of thing is the cause of hidden bugs.

It's all academic really;  no-one's going to use Decimal's 3-argument 
pow.  I'm not really sure why it's supported at all.  Come to that, I 
don't really understand why Python's 3-argument pow belongs in the core 
interpreter (as opposed to somewhere in the standard library).  If it 
hadn't been there, and if __pow__ didn't accept a third argument, I 
suspect no-one would have tried to implement 3-argument pow for Decimal.
History
Date User Action Args
2009-10-04 09:41:18mark.dickinsonsetrecipients: + mark.dickinson, skrah
2009-10-04 09:41:17mark.dickinsonsetmessageid: <1254649277.88.0.0533999761459.issue7049@psf.upfronthosting.co.za>
2009-10-04 09:41:16mark.dickinsonlinkissue7049 messages
2009-10-04 09:41:15mark.dickinsoncreate