Message105590
On Tue, May 11, 2010 at 5:58 PM, Mark Dickinson <report@bugs.python.org> wrote:
> Yes, I'm interested in seeing the pure Python version.
Here is my translation of the reference implementation.
> It could go into test_math, and would be a useful form of documentation.
Note that I copied the reference implementation recursive logic rather
than that in the proposed patch. It may be better for documentation
this way.
If we end up using something like this in documentation, I would
rename nminusnumofbits() to something more readable. Maybe "ntwos" or
"count_trailing_zeros" with an explanation why number of factors of 2
in factorial(n) is n - popcount(n). |
File name |
Uploaded |
factorial.py
|
belopolsky,
2010-05-12.14:39:21
|
|
Date |
User |
Action |
Args |
2010-05-12 14:44:45 | belopolsky | set | recipients:
+ belopolsky, rhettinger, mark.dickinson, stutzbach |
2010-05-12 14:41:53 | belopolsky | link | issue8692 messages |
2010-05-12 14:40:26 | belopolsky | create | |
|