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

Daniel Stutzbach report at bugs.python.org
Fri May 14 22:09:49 CEST 2010


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

I made a few minor updates to the patch.

It redefines partial_product to product(range(n, m, 2)), which saved me a few operations and is more Pythonic than what I had before. :-)

(Not quite what Alexander was after, but it's a step in the right direction.  His proposed defining of partial_product would have complicated my new base case.)

----------
Added file: http://bugs.python.org/file17345/factorial.patch

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


More information about the Python-bugs-list mailing list