We're dividing 585442 by 31 
We want to divide 585442 by 31.

Advancing to step 1:
The number 31 fits into 5 0 times, leaving a remainder of 5.
The next digit of our result is 0. 
Result so far: 0.0
If we take 0 away from 5, we end up with 5.
Append the next digit (8) from the dividend to 5 and continue with: 58 / 31

Advancing to step 2:
The number 31 fits into 58 1 times, leaving a remainder of 27.
The next digit of our result is 1. 
Result so far: 1.0
If we subtract 31 from 58, we get 27.
Include the next digit (5) from the dividend after 27, then repeat: 275 / 31

Going ahead to step 3:
The number 31 fits into 275 8 times, leaving a remainder of 27.
The next digit of our result is 8. 
Result so far: 18.0
If we take 248 away from 275, we end up with 27.
Bring next digit (4) of the dividend behind the 27 and repeat the process: 274 / 31

Moving on to step 4:
274 divided by 31 is 8 with a remainder of 26.
Write down 8 as next digit of the result. 
Result so far: 188.0
If we take 248 away from 274, we end up with 26.
Fetch the next digit (4) from the dividend, attach it to 26 and continue: 264 / 31

Let's proceed to step 5:
264 divided by 31 is 8 with a remainder of 16.
Use 8 as the next digit of our solution. 
Result so far: 1888.0
Subtract 248 from 264 to get 16.
Bring next digit (2) of the dividend behind the 16 and repeat the process: 162 / 31

Let's proceed to step 6:
162 divided by 31 is 5 with a remainder of 7.
The number 5 becomes the next digit in our result. 
Result so far: 18885.0
If we subtract 155 from 162, we get 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 7:
31 goes into 70 2 times with a remainder of 8.
Put 2 as the next digit of the answer. 
Result so far: 18885.2
If we take 62 away from 70, we end up 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.

Going ahead to step 8:
The number 31 fits into 80 2 times, leaving a remainder of 18.
Write down 2 as next digit of the result. 
Result so far: 18885.22
If we take 62 away from 80, we end up 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.

The quotient of the division is 18885.22, and the remainder is 0.018.