Fuzzy-Wozzy’s multiple precision division attempts have been going on now for quite a while!
I do commend his enthusiasm and perseverance, and I also acknowledge that he is writing Shen code,
albeit at a very naive level. The code is untyped, unnecessarily repetitive, and also inefficient.
Some of the functions he uses, e.g. mod, are readily available in the maths lib.
Representing multiple precision integers as lists of single digits for the purpose of manipulating them,
especially, in the context of division, is like attempting to drill a tunnel with a pen knife!
What I have seen so far, are examples of division by 3, 7 and some 3-digit ints, such as 223 and 158. What about
dividing a 100000-digit int by a 538-digit int? This is hard, and IMHO requires extensive study of
Knuth’s Algorithm D (Knuth, Seminumerical Algorithms, 2nd ed., p 257).
Multiple-precision ints are usually represented in suitably chosen groups of 5 or 6-digits integers, depending on platform, both for efficiency and convenience. Whether a list, or a vector representation in Shen is preferred, I cannot say, without trying it. And I don’t think I will have a go, certainly not at the moment.
Willi
--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.
Visit this group at http://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.