Python provides a "bignum" type called "long" which can represent arbitrarily large numbers. What is the internal representation of this type?
I ask in part because I am curious what operations might be particularly fast or slow on these numbers. For example, is bit shifting particularly fast compared to multiplication or division (as it is for "regular" ints)?
int
andlong
, and see which are faster! – Polychromaticint
andlong
, but in Python3, there is onlylong
(renamed toint
). This is how Python2int
is implemented. – Stripeint
. – Tirelesslongintrepr.h
– Stephine