-1 on overloading math.factorial to compute something that isn't a factorial, but a falling factorial. Such a new function would be easy to add, though, if deemed useful.

     math.falling_factorial(x, n) = product(range(x - n + 1, x + 1))

and the similar function

    math.rising_factorial(x, n) = product(range(x, x+n)) 

On Wed, Sep 17, 2014 at 7:02 PM, Ram Rachum <ram.rachum@gmail.com> wrote:
I suggest introducing a `start=1` argument to `math.factorial`, so the result would be (the C-optimized version of) `product(range(start, x+1), start=1)`. This'll be useful for combinatorical calculations.




_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/