0029. Divide Two Integers
Exponential Search with Bit Shifting — divide without *, /, or %
Dividend:
Divisor:
43 / 3 = 14
10 / 3 = 3
7 / (-2) = -3
-10 / 3 = -3
100 / 7 = 14
1024 / 1
0 / 5 = 0
-2^31 / -1 (overflow)
Step
Play
Pause
Reset
Speed:
5x
Remaining
—
Quotient
0
Current Chunk
—
Phase
Ready
Dividend Reduction
Remaining dividend:
Current chunk to subtract (divisor << shift):
Bit Shift Table
Shift
divisor << shift
Multiple
Fits?
Quotient Breakdown (powers of 2)