Let's divide 508642 by 31
We want to divide 508642 by 31.

Step 1:
If we divide 5 by 31, we get 0 and a remainder of 5.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Deduct 0 from 5 and we're left with 5.
Grab the next digit (0) from the dividend, add it to 5, then carry on: 50 / 31

Moving on to step 2:
When dividing 50 by 31, we get 1 with a remainder of 19.
Use 1 as the next digit of our solution. 
Result so far: 1.0
The remainder is 19 after subtracting 31 from 50.
Append the next digit (8) from the dividend to 19 and continue with: 198 / 31

On to step 3:
31 can be fit into 198 6 times, resulting in a remainder of 12.
Record the quotient 6 as the next digit in the result. 
Result so far: 16.0
The remainder is 12 after subtracting 186 from 198.
Grab the next digit (6) from the dividend, add it to 12, then carry on: 126 / 31

Moving on to step 4:
126 divided by 31 is 4 with a remainder of 2.
Write down 4 as next digit of the result. 
Result so far: 164.0
If we take 124 away from 126, we end up with 2.
Fetch the next digit (4) from the dividend, attach it to 2 and continue: 24 / 31

On to step 5:
31 goes into 24 0 times with a remainder of 24.
Put 0 as the next digit of the answer. 
Result so far: 1640.0
If we take 0 away from 24, we end up with 24.
Append the next digit (2) from the dividend to 24 and continue with: 242 / 31

Step 6:
31 goes into 242 7 times with a remainder of 25.
Use 7 as the next digit of our solution. 
Result so far: 16407.0
The remainder is 25 after subtracting 217 from 242.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

Moving on to step 7:
If we divide 250 by 31, we get 8 and a remainder of 2.
Use 8 as the next digit of our solution. 
Result so far: 16407.8
If we take 248 away from 250, we end up with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

On to step 8:
The number 31 fits into 20 0 times, leaving a remainder of 20.
Record the quotient 0 as the next digit in the result. 
Result so far: 16407.8
Deduct 0 from 20 and we're left with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Advancing to step 9:
31 can be fit into 200 6 times, resulting in a remainder of 14.
Record the quotient 6 as the next digit in the result. 
Result so far: 16407.806
The remainder is 14 after subtracting 186 from 200.
Since there are no more digits in the dividend, we add a zero to the remainder making it 140, and continue the process.

Let's proceed to step 10:
31 can be fit into 140 4 times, resulting in a remainder of 16.
Write down 4 as next digit of the result. 
Result so far: 16407.8064
If we subtract 124 from 140, we get 16.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Let's proceed to step 11:
When dividing 160 by 31, we get 5 with a remainder of 5.
Record the quotient 5 as the next digit in the result. 
Result so far: 16407.80645
Subtracting 155 from 160 leaves us with 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Let's proceed to step 12:
31 can be fit into 50 1 times, resulting in a remainder of 19.
The number 1 becomes the next digit in our result. 
Result so far: 16407.806451
Subtracting 31 from 50 leaves us with 19.
Since there are no more digits in the dividend, we add a zero to the remainder making it 190, and continue the process.

Step 13:
The number 31 fits into 190 6 times, leaving a remainder of 4.
The next digit of our result is 6. 
Result so far: 16407.8064516
The remainder is 4 after subtracting 186 from 190.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Step 14:
31 can be fit into 40 1 times, resulting in a remainder of 9.
Record the quotient 1 as the next digit in the result. 
Result so far: 16407.80645161
If we take 31 away from 40, we end up with 9.
Since there are no more digits in the dividend, we add a zero to the remainder making it 90, and continue the process.

The final result is 16407.80645161 with a remainder of 9e-09.