The right shift operator will divide by powers of 2. That's the only shortcut I use. Here are a few notes on Binary Division which might be fun.
Is this a bar bet or a school assignment? [ October 08, 2007: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Implement binary long division. Sure, regular base 10 long division uses a divide operation, but since the binary equivalent needs to arrive at either a 0 or a 1, you could get away with an if statement.
This algorithm would be O(log product), while the subtraction algorithm would be O(result).
Just the other day, I was thinking ... about this tiny ad:
a bit of art, as a gift, that will fit in a stocking