[issue8692] Use divide-and-conquer for faster factorials

Daniel Stutzbach report at bugs.python.org
Wed May 12 03:00:43 CEST 2010


Daniel Stutzbach <daniel at stutzbachenterprises.com> added the comment:

On Tue, May 11, 2010 at 7:15 PM, Alexander Belopolsky
<report at bugs.python.org> wrote:
> The main value in setting a theoretically justified limit is that
> overflow exception can carry a meaningful message, e.g. "factorial
> result would have too many digits", rather than an unhelpful "Python
> int too large to convert to C long".

I'm pretty sure this is an orthogonal issue to speeding up
math.factorial.  If you want to improve the error and/or impose a
tighter maximum limit on n, would you mind opening it as a separate
issue?

I like extra checks and I like speed, but I can't think about adding
extra checks and a speed patch at the same time. ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8692>
_______________________________________


More information about the Python-bugs-list mailing list