[I found this via the python-ideas thread] Wolfgang Maier <wolfgang.maier <at> biologie.uni-freiburg.de> writes: > math.factorial is accurate and faster than your pure-Python function, especially for large numbers.
It is slower for huge numbers than decimal if you use this Python function: http://www.bytereef.org/mpdecimal/quickstart.html#factorial-in-pure-python Be sure to set MAX_EMAX and MIN_EMIN, that's missing in the example. If you want to *see* all digits of a very large number, then decimal is probably even faster than gmpy. See: http://www.bytereef.org/mpdecimal/benchmarks.html#arbitrary-precision-libraries Stefan Krah -- https://mail.python.org/mailman/listinfo/python-list