Let's divide 166365 by 31
Our goal is to divide 166365 by 31.

Step 1:
If we divide 1 by 31, we get 0 and a remainder of 1.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we subtract 0 from 1, we get 1.
Append the next digit (6) from the dividend to 1 and continue with: 16 / 31

Let's proceed to step 2:
16 divided by 31 is 0 with a remainder of 16.
The next digit of our result is 0. 
Result so far: 0.0
The remainder is 16 after subtracting 0 from 16.
Bring next digit (6) of the dividend behind the 16 and repeat the process: 166 / 31

Step 3:
When dividing 166 by 31, we get 5 with a remainder of 11.
Put 5 as the next digit of the answer. 
Result so far: 5.0
Subtracting 155 from 166 leaves us with 11.
Grab the next digit (3) from the dividend, add it to 11, then carry on: 113 / 31

Step 4:
31 can be fit into 113 3 times, resulting in a remainder of 20.
Use 3 as the next digit of our solution. 
Result so far: 53.0
If we take 93 away from 113, we end up with 20.
Grab the next digit (6) from the dividend, add it to 20, then carry on: 206 / 31

On to step 5:
The number 31 fits into 206 6 times, leaving a remainder of 20.
Record the quotient 6 as the next digit in the result. 
Result so far: 536.0
If we subtract 186 from 206, we get 20.
Take the next digit (5) from the dividend and append it to 20, then repeat: 205 / 31

On to step 6:
When dividing 205 by 31, we get 6 with a remainder of 19.
Put 6 as the next digit of the answer. 
Result so far: 5366.0
Deduct 186 from 205 and we're left 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.

On to step 7:
31 can be fit into 190 6 times, resulting in a remainder of 4.
The number 6 becomes the next digit in our result. 
Result so far: 5366.6
If we subtract 186 from 190, we get 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

On to step 8:
When dividing 40 by 31, we get 1 with a remainder of 9.
Put 1 as the next digit of the answer. 
Result so far: 5366.61
Deduct 31 from 40 and we're left 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.

Let's proceed to step 9:
90 divided by 31 is 2 with a remainder of 28.
Use 2 as the next digit of our solution. 
Result so far: 5366.612
The remainder is 28 after subtracting 62 from 90.
Since there are no more digits in the dividend, we add a zero to the remainder making it 280, and continue the process.

On to step 10:
31 goes into 280 9 times with a remainder of 1.
Record the quotient 9 as the next digit in the result. 
Result so far: 5366.6129
If we subtract 279 from 280, we get 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Moving on to step 11:
The number 31 fits into 10 0 times, leaving a remainder of 10.
The next digit of our result is 0. 
Result so far: 5366.6129
Deduct 0 from 10 and we're left with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Advancing to step 12:
The number 31 fits into 100 3 times, leaving a remainder of 7.
Put 3 as the next digit of the answer. 
Result so far: 5366.612903
If we take 93 away from 100, we end up with 7.
Since there are no more digits in the dividend, we add a zero to the remainder making it 70, and continue the process.

Step 13:
70 divided by 31 is 2 with a remainder of 8.
Put 2 as the next digit of the answer. 
Result so far: 5366.6129032
Deduct 62 from 70 and we're left with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

On to step 14:
The number 31 fits into 80 2 times, leaving a remainder of 18.
Put 2 as the next digit of the answer. 
Result so far: 5366.61290322
If we subtract 62 from 80, we get 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

Our division results in 5366.61290322 with a remaining 1.8e-08.