20050118, 00:27  #1 
71×113 Posts 
need C implementation of divb(r,k)
i am trying to implement the algorithms in "DETECTING PERFECT POWERS
IN ESSENTIALLY LINEAR TIME" by dj bernstein, and a required function is divb(r,k), which is apparently found in "The art of computer programming, volume 2: seminumerical algorithms" ex 4.3.116, but since i do not have access to this book i am stuck without it. if someone could provide the alogrithm, an implementation or a link either of these it would be greatfully appreciated. 
20050118, 01:58  #2 
Aug 2002
2^{6}×5 Posts 
Too bad you didn't ask yesterday since I have the book at home.
Maybe if you explain what the function is supposed to do, we could help. 
20050118, 02:12  #3 
P90 years forever!
Aug 2002
Yeehaw, FL
3·11·227 Posts 

20050118, 08:44  #4 
"Nancy"
Aug 2002
Alexandria
4643_{8} Posts 
Text of exercise 4.3.116:
(Short division.) Design an algorithm that divides a nonnegative nplace integer (u_{n1} ... u_1 u_0)_b by v, where v is a singleprecision number (that is, 0 < v < b), producing the quotient (w_{n1} ... w_1 w_0)_b and remainder r. Sounds like grammerschool division by a single digit (in base b) integer  shouldn't be hard to do. Alex 
20050118, 23:14  #5 
2^{2}·3·743 Posts 
Thanks akruppa, that was exactly what I was lookin for, hmm wonder if any libraries here in NZ have a copy of that book...
also the bignum thing looks interesting, I could use it in the future to handle bigger numbers. 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Wii U, good concept, bad implementation?  jasong  jasong  6  20131023 18:34 
SQUFOF implementation  alpertron  Factoring  15  20100412 19:16 
ECM/FPGA Implementation  rdotson  Hardware  12  20060326 22:58 
RSA implementation  flava  Programming  12  20041026 03:51 
Different types of factoring, implementation  dsouza123  Factoring  12  20030808 11:35 