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

Let's proceed to step 1:
When dividing 5 by 31, we get 0 with a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Fetch the next digit (4) from the dividend, attach it to 5 and continue: 54 / 31

On to step 2:
The number 31 fits into 54 1 times, leaving a remainder of 23.
Write down 1 as next digit of the result. 
Result so far: 1.0
The remainder is 23 after subtracting 31 from 54.
Include the next digit (0) from the dividend after 23, then repeat: 230 / 31

Step 3:
31 goes into 230 7 times with a remainder of 13.
Put 7 as the next digit of the answer. 
Result so far: 17.0
Deduct 217 from 230 and we're left with 13.
Grab the next digit (5) from the dividend, add it to 13, then carry on: 135 / 31

Step 4:
31 can be fit into 135 4 times, resulting in a remainder of 11.
The next digit of our result is 4. 
Result so far: 174.0
Deduct 124 from 135 and we're left with 11.
Fetch the next digit (0) from the dividend, attach it to 11 and continue: 110 / 31

Step 5:
31 can be fit into 110 3 times, resulting in a remainder of 17.
Record the quotient 3 as the next digit in the result. 
Result so far: 1743.0
If we take 93 away from 110, we end up with 17.
Append the next digit (8) from the dividend to 17 and continue with: 178 / 31

Advancing to step 6:
When dividing 178 by 31, we get 5 with a remainder of 23.
Record the quotient 5 as the next digit in the result. 
Result so far: 17435.0
If we take 155 away from 178, we end up with 23.
Since there are no more digits in the dividend, we add a zero to the remainder making it 230, and continue the process.

Moving on to step 7:
When dividing 230 by 31, we get 7 with a remainder of 13.
The number 7 becomes the next digit in our result. 
Result so far: 17435.7
The remainder is 13 after subtracting 217 from 230.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

Moving on to step 8:
The number 31 fits into 130 4 times, leaving a remainder of 6.
Put 4 as the next digit of the answer. 
Result so far: 17435.74
If we take 124 away from 130, we end up with 6.
Since there are no more digits in the dividend, we add a zero to the remainder making it 60, and continue the process.

Step 9:
When dividing 60 by 31, we get 1 with a remainder of 29.
The number 1 becomes the next digit in our result. 
Result so far: 17435.741
If we subtract 31 from 60, we get 29.
Since there are no more digits in the dividend, we add a zero to the remainder making it 290, and continue the process.

On to step 10:
The number 31 fits into 290 9 times, leaving a remainder of 11.
The next digit of our result is 9. 
Result so far: 17435.7419
Subtract 279 from 290 to get 11.
Since there are no more digits in the dividend, we add a zero to the remainder making it 110, and continue the process.

Let's proceed to step 11:
When dividing 110 by 31, we get 3 with a remainder of 17.
Record the quotient 3 as the next digit in the result. 
Result so far: 17435.74193
The remainder is 17 after subtracting 93 from 110.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Step 12:
When dividing 170 by 31, we get 5 with a remainder of 15.
The number 5 becomes the next digit in our result. 
Result so far: 17435.741935
If we take 155 away from 170, we end up with 15.
Since there are no more digits in the dividend, we add a zero to the remainder making it 150, and continue the process.

Let's proceed to step 13:
When dividing 150 by 31, we get 4 with a remainder of 26.
The number 4 becomes the next digit in our result. 
Result so far: 17435.7419354
Subtract 124 from 150 to get 26.
Since there are no more digits in the dividend, we add a zero to the remainder making it 260, and continue the process.

Moving on to step 14:
31 goes into 260 8 times with a remainder of 12.
Record the quotient 8 as the next digit in the result. 
Result so far: 17435.74193548
Subtract 248 from 260 to get 12.
Since there are no more digits in the dividend, we add a zero to the remainder making it 120, and continue the process.

The final outcome is 17435.74193548, with a leftover of 1.2e-08.