Let's divide 398174 by 31
We're looking to find how many times 31 goes into 398174.

On to step 1:
If we divide 3 by 31, we get 0 and a remainder of 3.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
The remainder is 3 after subtracting 0 from 3.
Include the next digit (9) from the dividend after 3, then repeat: 39 / 31

Going ahead to step 2:
When dividing 39 by 31, we get 1 with a remainder of 8.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
Subtract 31 from 39 to get 8.
Append the next digit (8) from the dividend to 8 and continue with: 88 / 31

Advancing to step 3:
The number 31 fits into 88 2 times, leaving a remainder of 26.
Use 2 as the next digit of our solution. 
Result so far: 12.0
Subtracting 62 from 88 leaves us with 26.
Bring next digit (1) of the dividend behind the 26 and repeat the process: 261 / 31

Going ahead to step 4:
The number 31 fits into 261 8 times, leaving a remainder of 13.
Use 8 as the next digit of our solution. 
Result so far: 128.0
Subtract 248 from 261 to get 13.
Grab the next digit (7) from the dividend, add it to 13, then carry on: 137 / 31

On to step 5:
31 can be fit into 137 4 times, resulting in a remainder of 13.
Record the quotient 4 as the next digit in the result. 
Result so far: 1284.0
Deduct 124 from 137 and we're left with 13.
Include the next digit (4) from the dividend after 13, then repeat: 134 / 31

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

Moving on to step 7:
31 goes into 100 3 times with a remainder of 7.
Record the quotient 3 as the next digit in the result. 
Result so far: 12844.3
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.

Let's proceed to step 8:
If we divide 70 by 31, we get 2 and a remainder of 8.
The next digit of our result is 2. 
Result so far: 12844.32
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.

Step 9:
80 divided by 31 is 2 with a remainder of 18.
Use 2 as the next digit of our solution. 
Result so far: 12844.322
Deduct 62 from 80 and we're left with 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

After the division, we end up with 12844.322 and a remainder of 0.0018.