arbitrary long integer aritmetics

Erik Max Francis max at alcyone.com
Thu Jul 3 00:14:48 CEST 2003


Russell Reagan wrote:

> "Fredrik Lundh" <fredrik at pythonware.com> wrote
> 
> > >>> 2147483647 * 2147483647 * 2147483647
> > 4611686014132420609L
> >
> > (note the trailing L).
> 
> Oddly, I get a different answer than you. What's the problem?

Probably because he pasted in an incomplete transcript.  The calculation
he shows is multiplying it twice, not three times:

>>> x = 2147483647L
>>> x**2
4611686014132420609L
>>> x**3
9903520300447984150353281023L

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Divorces are made in Heaven.
\__/  Oscar Wilde




More information about the Python-list mailing list