Google Interview Question

If you have a computer with no division operator, how do you do it

Interview Answer

Anonymous

May 16, 2012

1. Subtract repeatedly the denominator till remainder less than denominator 2. Keep doing 2 * last multiplier where last multiplier starts with denominator till the result goes bigger than numerator. Doubling since easy to do with left shift. Then figure out remainder / denominator.