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

Going ahead to step 1:
40 can be fit into 3 0 times, resulting in a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we subtract 0 from 3, we get 3.
Fetch the next digit (9) from the dividend, attach it to 3 and continue: 39 / 40

Advancing to step 2:
40 goes into 39 0 times with a remainder of 39.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we take 0 away from 39, we end up with 39.
Take the next digit (7) from the dividend and append it to 39, then repeat: 397 / 40

Step 3:
397 divided by 40 is 9 with a remainder of 37.
Record the quotient 9 as the next digit in the result. 
Result so far: 9.0
The remainder is 37 after subtracting 360 from 397.
Grab the next digit (5) from the dividend, add it to 37, then carry on: 375 / 40

Going ahead to step 4:
When dividing 375 by 40, we get 9 with a remainder of 15.
The number 9 becomes the next digit in our result. 
Result so far: 99.0
The remainder is 15 after subtracting 360 from 375.
Take the next digit (9) from the dividend and append it to 15, then repeat: 159 / 40

Step 5:
If we divide 159 by 40, we get 3 and a remainder of 39.
The number 3 becomes the next digit in our result. 
Result so far: 993.0
Subtract 120 from 159 to get 39.
Append the next digit (4) from the dividend to 39 and continue with: 394 / 40

Going ahead to step 6:
The number 40 fits into 394 9 times, leaving a remainder of 34.
Record the quotient 9 as the next digit in the result. 
Result so far: 9939.0
Subtracting 360 from 394 leaves us with 34.
Since there are no more digits in the dividend, we add a zero to the remainder making it 340, and continue the process.

Let's proceed to step 7:
40 goes into 340 8 times with a remainder of 20.
Use 8 as the next digit of our solution. 
Result so far: 9939.8
If we take 320 away from 340, 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.

Moving on 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: 9939.85
Subtracting 200 from 200 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.

On to step 9:
40 goes into 0 0 times with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 9939.85
The remainder is 0 after subtracting 0 from 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:
The number 40 fits into 0 0 times, leaving a remainder of 0.
The next digit of our result is 0. 
Result so far: 9939.85
If we subtract 0 from 0, 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.

Our division results in 9939.85 with a remaining 0.0.