ISO module for binomial coefficients, etc.
Dave Angel
davea at ieee.org
Sun Jan 24 07:07:55 EST 2010
kj wrote:
> Before I go off to re-invent a thoroughly invented wheel, I thought
> I'd ask around for some existing module for computing binomial
> coefficient, hypergeometric coefficients, and other factorial-based
> combinatorial indices. I'm looking for something that can handle
> fairly large factorials (on the order of 10000!), using floating-point
> approximations as needed, and is smart about optimizations,
> memoizations, etc.
>
> TIA!
>
> ~K
>
>
You do realize that a standard. python floating point number cannot
possibly approximate a number like 10000! Better use longs.
I'd check out the gamma function, which matches factorial for integer
arguments (plus or minus 1).
DaveA
More information about the Python-list
mailing list