shift operators?

Alex Martelli aleax at aleax.it
Tue Jan 8 11:21:18 EST 2002


"Donn Cave" <donn at u.washington.edu> wrote in message
news:a1d7in$18ca$1 at nntp6.u.washington.edu...
    ...
> Quoth Andrew Koenig <ark at research.att.com>:
> | Jakob> Andrew Koenig wrote:
> |
> | >> Is it just backward compatibility that keeps 1<<40 from yielding
> | >> 1099511627776L as well?
    ...
> -  The alternative is easy enough - use explicit longs, or I suppose
>    multiplication by 2 works too?

Sure, or, raising 2 to some power:

>>> 2**40
1099511627776L


Alex






More information about the Python-list mailing list