It's worth mentioning that this is doing long division via repeated subtraction completely mechanically, just using the electric motor to power the gears. If you watch closely you can see it detect underflows, increment, and then shift right to the next digit.
Here's another view of the same operation from the back so you can see more of the gears move.