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

Advancing to step 1:
40 goes into 5 0 times with a remainder of 5.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we take 0 away from 5, we end up with 5.
Include the next digit (8) from the dividend after 5, then repeat: 58 / 40

Moving on to step 2:
When dividing 58 by 40, we get 1 with a remainder of 18.
Put 1 as the next digit of the answer. 
Result so far: 1.0
Subtract 40 from 58 to get 18.
Take the next digit (1) from the dividend and append it to 18, then repeat: 181 / 40

Step 3:
If we divide 181 by 40, we get 4 and a remainder of 21.
The next digit of our result is 4. 
Result so far: 14.0
If we subtract 160 from 181, we get 21.
Grab the next digit (8) from the dividend, add it to 21, then carry on: 218 / 40

Going ahead to step 4:
40 can be fit into 218 5 times, resulting in a remainder of 18.
Put 5 as the next digit of the answer. 
Result so far: 145.0
The remainder is 18 after subtracting 200 from 218.
Fetch the next digit (7) from the dividend, attach it to 18 and continue: 187 / 40

Step 5:
The number 40 fits into 187 4 times, leaving a remainder of 27.
Write down 4 as next digit of the result. 
Result so far: 1454.0
Deduct 160 from 187 and we're left with 27.
Take the next digit (0) from the dividend and append it to 27, then repeat: 270 / 40

On to step 6:
When dividing 270 by 40, we get 6 with a remainder of 30.
Put 6 as the next digit of the answer. 
Result so far: 14546.0
Subtract 240 from 270 to get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Let's proceed to step 7:
If we divide 300 by 40, we get 7 and a remainder of 20.
The number 7 becomes the next digit in our result. 
Result so far: 14546.7
Deduct 280 from 300 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 8:
40 goes into 200 5 times with a remainder of 0.
The next digit of our result is 5. 
Result so far: 14546.75
If we subtract 200 from 200, we get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Moving on to step 9:
If we divide 0 by 40, we get 0 and a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 14546.75
Subtracting 0 from 0 leaves us with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Step 10:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 14546.75
Deduct 0 from 0 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

The final result is 14546.75 with a remainder of 0.0.