Hi and I am making a maths library which will accept infinit digits but what is the best formula a computer can understand for devision. The only one I have come across so far is long devision but is there anything better? The following is the kinda formula I am thinking of doing...
input1=8
input2=3
amount=0
answer=0
while (amount<=(input1-input2)) {
amount = amount + input2
answer = answer + 1
}
remainder = input1-amount
//------ results
remainder
floor of answer
//------
Now that I have the floor(answer) and the remainder, how do I work out the 0.666666666 which ((1/input2)*remainder) will give. Of course I am making a division algorithm so I can't use division or multiplication to get the answer. I can only use addition and subtraction. I think long devision is a slow answer but is there anything faster. By faster I mean less use of addition and subtraction but only use of addition and subtraction. Any ideas explained clearly??