arbitrary long integer aritmetics

Russell Reagan rreagan at attbi.com
Wed Jul 2 12:40:39 EDT 2003


"Fredrik Lundh" <fredrik at pythonware.com> wrote

> $ python
> Python 2.2
> >>> import sys
> >>> sys.maxint
> 2147483647
> >>> 2147483647 * 2147483647 * 2147483647
> 4611686014132420609L
>
> (note the trailing L).

Oddly, I get a different answer than you. What's the problem?

$ python
Python 2.2.3 (#1, Jun 19 2003, 12:10:13)
[GCC 3.2 20020927 (prerelease)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.maxint
2147483647
>>> 2147483647 * 2147483647 * 2147483647
9903520300447984150353281023L







More information about the Python-list mailing list