The kernel of the long / long implementation in Python 3.3 is located in longobject.c as an x_divrem function.
The implementation is modeled after Knuth, “The Art of Computer Programming,” Vol. 2 (3rd edition), Section 4.3.1, Algorithm D, “Separation of Non-Negative Integers,” for comment from the source.
source share