587398 divided by 40 
Let's see how many times 40 fits into 587398.

Step 1:
40 goes into 5 0 times with a remainder of 5.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Fetch the next digit (8) from the dividend, attach it to 5 and continue: 58 / 40

Advancing 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
Deduct 40 from 58 and we're left with 18.
Take the next digit (7) from the dividend and append it to 18, then repeat: 187 / 40

Step 3:
If we divide 187 by 40, we get 4 and a remainder of 27.
Record the quotient 4 as the next digit in the result. 
Result so far: 14.0
The remainder is 27 after subtracting 160 from 187.
Grab the next digit (3) from the dividend, add it to 27, then carry on: 273 / 40

Step 4:
40 can be fit into 273 6 times, resulting in a remainder of 33.
Write down 6 as next digit of the result. 
Result so far: 146.0
If we subtract 240 from 273, we get 33.
Fetch the next digit (9) from the dividend, attach it to 33 and continue: 339 / 40

Moving on to step 5:
40 goes into 339 8 times with a remainder of 19.
The number 8 becomes the next digit in our result. 
Result so far: 1468.0
Deduct 320 from 339 and we're left with 19.
Take the next digit (8) from the dividend and append it to 19, then repeat: 198 / 40

Moving on to step 6:
198 divided by 40 is 4 with a remainder of 38.
Use 4 as the next digit of our solution. 
Result so far: 14684.0
Subtract 160 from 198 to get 38.
Since there are no more digits in the dividend, we add a zero to the remainder making it 380, and continue the process.

Moving on to step 7:
If we divide 380 by 40, we get 9 and a remainder of 20.
The number 9 becomes the next digit in our result. 
Result so far: 14684.9
If we take 360 away from 380, we end up 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.

On 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: 14684.95
Deduct 200 from 200 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.

On to step 9:
40 goes into 0 0 times with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 14684.95
If we take 0 away from 0, we end up 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.

Let's proceed to step 10:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 14684.95
If we take 0 away from 0, we end up 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 14684.95 with a remainder of 0.0.