I am trying to implement a long split for bignums. I cannot use a library such as GMP, unfortunately, due to limitations of the embedded programming. In addition, I want the intellectual exercise to learn how to implement it. So far, I have had addition and multiplication using arrays of length in bytes (so each byte is similar to the value of base-256).
I'm just trying to start implementing a unit / module, and I want to know where to start? I found a lot of optimized (aka unreadable) code on the network that does not help me, and I found a lot of high-tech mathematical documents from which I can not bridge the gap between theory and implementation.
If someone could recommend a popular algorithm and point me to a simple one to understand the explanation that tends to implant, that would be fantastic.
-edit: I need algorithms that work when the dividend is ~ 4000 bits and the divisor is ~ 2000 bits.
-edit: Will this algorithm work with a 256 base? http://courses.cs.vt.edu/~cs1104/BuildingBlocks/divide.030.html
-edit: Do I really have to use an algorithm (Newton's division)? http://en.wikipedia.org/wiki/Division_(digital)#Newton.E2.80.93Raphson_division
division bignum gmp
Chris
source share