798590 divided by 40 
We're looking to find how many times 40 goes into 798590.

On to step 1:
When dividing 7 by 40, we get 0 with a remainder of 7.
The next digit of our result is 0. 
Result so far: 0.0
Deduct 0 from 7 and we're left with 7.
Include the next digit (9) from the dividend after 7, then repeat: 79 / 40

On to step 2:
40 can be fit into 79 1 times, resulting in a remainder of 39.
The next digit of our result is 1. 
Result so far: 1.0
The remainder is 39 after subtracting 40 from 79.
Grab the next digit (8) from the dividend, add it to 39, then carry on: 398 / 40

Let's proceed to step 3:
398 divided by 40 is 9 with a remainder of 38.
Record the quotient 9 as the next digit in the result. 
Result so far: 19.0
If we take 360 away from 398, we end up with 38.
Include the next digit (5) from the dividend after 38, then repeat: 385 / 40

On to step 4:
385 divided by 40 is 9 with a remainder of 25.
Put 9 as the next digit of the answer. 
Result so far: 199.0
The remainder is 25 after subtracting 360 from 385.
Include the next digit (9) from the dividend after 25, then repeat: 259 / 40

Advancing to step 5:
When dividing 259 by 40, we get 6 with a remainder of 19.
Write down 6 as next digit of the result. 
Result so far: 1996.0
Subtract 240 from 259 to get 19.
Append the next digit (0) from the dividend to 19 and continue with: 190 / 40

Advancing to step 6:
190 divided by 40 is 4 with a remainder of 30.
The next digit of our result is 4. 
Result so far: 19964.0
Deduct 160 from 190 and we're left with 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Step 7:
The number 40 fits into 300 7 times, leaving a remainder of 20.
The next digit of our result is 7. 
Result so far: 19964.7
Subtracting 280 from 300 leaves us 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:
200 divided by 40 is 5 with a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 19964.75
Subtract 200 from 200 to 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.

Let's proceed to step 9:
40 goes into 0 0 times with a remainder of 0.
The next digit of our result is 0. 
Result so far: 19964.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.

Let's proceed to step 10:
0 divided by 40 is 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 19964.75
Subtract 0 from 0 to 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.

After the division, we end up with 19964.75 and a remainder of 0.0.