arbitrary long integer aritmetics

Fredrik Lundh fredrik at pythonware.com
Wed Jul 2 12:05:29 CEST 2003


"Leo" wrote:

> is there a python module around allow using arbitrary long integers?

nope, but it's built into the language:

    http://www.python.org/doc/current/ref/integers.html
    http://www.python.org/doc/current/ref/types.html

> i.e. the result of an integer operation is as long as necessary, so that a*b
> never produces an overflow error.

what's an overflow error? ;-)

$ python
Python 2.2
>>> import sys
>>> sys.maxint
2147483647
>>> 2147483647 * 2147483647 * 2147483647
4611686014132420609L

(note the trailing L).

</F>








More information about the Python-list mailing list