Division Algorithm "help"

Soldato
Joined
20 Jun 2005
Posts
3,826
Location
London..
Figured i would get most replies here!
Trying to understand this algorithm:

12et.JPG


And i don't understand the solution, i've dry run it a few times but i seem to get stuck. I don't understand where the numbers which the backwards arrow(s) point to in the solution, can anyone help?

Here is the soln.
Capture.JPG


Cheers :)
 
All I can see is that you are defining a function recursively. So if you don't calculate the divide function directly, you can follow the steps till you get to divide (0,x) which always has the answer (0,0). From there you can follow the steps backwards till you get the original answer you wanted.
 
Back
Top Bottom