We're dividing 40538507 by 977 
We want to divide 40538507 by 977.

Advancing to step 1:
977 goes into 4 0 times with a remainder of 4.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Subtract 0 from 4 to get 4.
Grab the next digit (0) from the dividend, add it to 4, then carry on: 40 / 977

Advancing to step 2:
The number 977 fits into 40 0 times, leaving a remainder of 40.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
If we take 0 away from 40, we end up with 40.
Take the next digit (5) from the dividend and append it to 40, then repeat: 405 / 977

Advancing to step 3:
The number 977 fits into 405 0 times, leaving a remainder of 405.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 405 after subtracting 0 from 405.
Take the next digit (3) from the dividend and append it to 405, then repeat: 4053 / 977

On to step 4:
When dividing 4053 by 977, we get 4 with a remainder of 145.
The number 4 becomes the next digit in our result. 
Result so far: 4.0
Subtracting 3908 from 4053 leaves us with 145.
Take the next digit (8) from the dividend and append it to 145, then repeat: 1458 / 977

Moving on to step 5:
The number 977 fits into 1458 1 times, leaving a remainder of 481.
Write down 1 as next digit of the result. 
Result so far: 41.0
If we take 977 away from 1458, we end up with 481.
Grab the next digit (5) from the dividend, add it to 481, then carry on: 4815 / 977

Advancing to step 6:
The number 977 fits into 4815 4 times, leaving a remainder of 907.
Record the quotient 4 as the next digit in the result. 
Result so far: 414.0
If we take 3908 away from 4815, we end up with 907.
Fetch the next digit (0) from the dividend, attach it to 907 and continue: 9070 / 977

Step 7:
9070 divided by 977 is 9 with a remainder of 277.
The next digit of our result is 9. 
Result so far: 4149.0
If we take 8793 away from 9070, we end up with 277.
Include the next digit (7) from the dividend after 277, then repeat: 2777 / 977

Let's proceed to step 8:
If we divide 2777 by 977, we get 2 and a remainder of 823.
Record the quotient 2 as the next digit in the result. 
Result so far: 41492.0
Deduct 1954 from 2777 and we're left with 823.
Since there are no more digits in the dividend, we add a zero to the remainder making it 8230, and continue the process.

Moving on to step 9:
8230 divided by 977 is 8 with a remainder of 414.
The next digit of our result is 8. 
Result so far: 41492.8
Subtract 7816 from 8230 to get 414.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4140, and continue the process.

Going ahead to step 10:
4140 divided by 977 is 4 with a remainder of 232.
Record the quotient 4 as the next digit in the result. 
Result so far: 41492.84
The remainder is 232 after subtracting 3908 from 4140.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2320, and continue the process.

Going ahead to step 11:
The number 977 fits into 2320 2 times, leaving a remainder of 366.
The next digit of our result is 2. 
Result so far: 41492.842
The remainder is 366 after subtracting 1954 from 2320.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3660, and continue the process.

Step 12:
The number 977 fits into 3660 3 times, leaving a remainder of 729.
The number 3 becomes the next digit in our result. 
Result so far: 41492.8423
Deduct 2931 from 3660 and we're left with 729.
Since there are no more digits in the dividend, we add a zero to the remainder making it 7290, and continue the process.

Advancing to step 13:
When dividing 7290 by 977, we get 7 with a remainder of 451.
The next digit of our result is 7. 
Result so far: 41492.84237
Subtract 6839 from 7290 to get 451.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4510, and continue the process.

On to step 14:
977 can be fit into 4510 4 times, resulting in a remainder of 602.
Put 4 as the next digit of the answer. 
Result so far: 41492.842374
Deduct 3908 from 4510 and we're left with 602.
Since there are no more digits in the dividend, we add a zero to the remainder making it 6020, and continue the process.

Advancing to step 15:
977 can be fit into 6020 6 times, resulting in a remainder of 158.
Record the quotient 6 as the next digit in the result. 
Result so far: 41492.8423746
Subtract 5862 from 6020 to get 158.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1580, and continue the process.

Advancing to step 16:
977 goes into 1580 1 times with a remainder of 603.
Put 1 as the next digit of the answer. 
Result so far: 41492.84237461
If we subtract 977 from 1580, we get 603.
Since there are no more digits in the dividend, we add a zero to the remainder making it 6030, and continue the process.

The final outcome is 41492.84237461, with a leftover of 6.03e-07.