memoize factorial example (was Re: decorators ?)

Fernando Perez fperez528 at yahoo.com
Wed Dec 8 04:35:25 CET 2004


Fernando Perez wrote:

> No, fact(0)==1 simply because any proper definition of a factorial has to
> match
> up with the gamma function (offset by one) at all non-negative integers.  So
> there's no room for any ambiguity here.

I should have added a link to the ever-useful mathworld:

http://mathworld.wolfram.com/Factorial.html

This has as much detail about n! and Gamma(z) as you'll ever want to know :)

Cheers,

f




More information about the Python-list mailing list