We're dividing 586645 by 40 
Let's see how many times 40 fits into 586645.

Let's proceed to step 1:
40 goes into 5 0 times with a remainder of 5.
The next digit of our result is 0. 
Result so far: 0.0
Subtracting 0 from 5 leaves us with 5.
Grab the next digit (8) from the dividend, add it to 5, then carry on: 58 / 40

Step 2:
58 divided by 40 is 1 with a remainder of 18.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Subtracting 40 from 58 leaves us with 18.
Include the next digit (6) from the dividend after 18, then repeat: 186 / 40

Going ahead to step 3:
If we divide 186 by 40, we get 4 and a remainder of 26.
Record the quotient 4 as the next digit in the result. 
Result so far: 14.0
Subtracting 160 from 186 leaves us with 26.
Bring next digit (6) of the dividend behind the 26 and repeat the process: 266 / 40

On to step 4:
40 goes into 266 6 times with a remainder of 26.
Record the quotient 6 as the next digit in the result. 
Result so far: 146.0
Deduct 240 from 266 and we're left with 26.
Grab the next digit (4) from the dividend, add it to 26, then carry on: 264 / 40

Moving on to step 5:
If we divide 264 by 40, we get 6 and a remainder of 24.
The number 6 becomes the next digit in our result. 
Result so far: 1466.0
Deduct 240 from 264 and we're left with 24.
Append the next digit (5) from the dividend to 24 and continue with: 245 / 40

Step 6:
If we divide 245 by 40, we get 6 and a remainder of 5.
The number 6 becomes the next digit in our result. 
Result so far: 14666.0
The remainder is 5 after subtracting 240 from 245.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Advancing to step 7:
If we divide 50 by 40, we get 1 and a remainder of 10.
The number 1 becomes the next digit in our result. 
Result so far: 14666.1
If we take 40 away from 50, we end up with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Going ahead to step 8:
100 divided by 40 is 2 with a remainder of 20.
Use 2 as the next digit of our solution. 
Result so far: 14666.12
If we subtract 80 from 100, we get 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 9:
The number 40 fits into 200 5 times, leaving a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 14666.125
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.

Advancing to step 10:
40 goes into 0 0 times with a remainder of 0.
The next digit of our result is 0. 
Result so far: 14666.125
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.

Going ahead to step 11:
The number 40 fits into 0 0 times, leaving a remainder of 0.
The next digit of our result is 0. 
Result so far: 14666.125
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.

The final outcome is 14666.125, with a leftover of 0.0.