fdarkangel
- 24
- 0
master_coda said:Your definition of division is not the same as the definition of division on the real numbers.
i guess you're implying the irrational numbers. i was not willing to expand the algoritm for non-integer results. i have never given any irrational number input. if you mean the non-integer results.. well, here it goes:
let A and B two reel numbers. subtract B from A until A is bigger or equal to zero, and add 1 to the division at each step. after this process, if A is negative, undo the one step. multiply A with 10 (or what ever the step is) and add 10^{-1} to the result after each subraction. repeat these steps until A=0, and decrement the power of 10 (to generalize, base) by 1.
however, i'd like to point that the original question is integer-wise, and this definition was uncessary.