3 ms·
For those who don't know how Python 2 integers work and don't have a Python 2 interpreter at hand: type(1 << x) is int for small x, but long for large x. http
by jwilk 9y ago
For those who don't know how Python 2 integers work and don't have a Python 2 interpreter at hand:
type(1 << x) is int for small x, but long for large x.
https://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex https://docs.python.org/2/library/stdtypes.html#numeric-type...
"Plain integers (also just called integers) are implemented using long in C, which gives them at least 32 bits of precision (sys.maxint is always set to the maximum plain integer value for the current platform, the minimum value is -sys.maxint - 1). Long integers have unlimited precision."
The distinction between plain and long integers is gone in Python 3.