Source Python Full Precision Division

I've been working with arbitrary precision algorithms lately, and I'm very curious how Python goes about this. When I print very large (600-1000) digits separated by another equally large number, it just works, and I love it. I have Python source files and everything is fine with C, which / where in the source is the part that controls this division, so I can look at it and maybe work with it? My final game is work like number theory in C.

+6
source share
1 answer

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.

+2
source

All Articles