arbitrary long integer aritmetics

Miki Tebeka tebeka at
Wed Jul 2 14:07:43 CEST 2003

Hello Leo,

> is there a python module around allow using arbitrary long integers?
> i.e. the result of an integer operation is as long as necessary, so that a*b
> never produces an overflow error. (but rather an out of memory error ;-) )
It's built in:
>>> from operator import mul
>>> def fact(x):
	return reduce(mul, range(2, x + 1), 1)
>>> fact(100L)


More information about the Python-list mailing list