We're dividing 40518042 by 159 
We want to divide 40518042 by 159.

Let's proceed to step 1:
159 can be fit into 4 0 times, resulting in a remainder of 4.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 4 to get 4.
Take the next digit (0) from the dividend and append it to 4, then repeat: 40 / 159

Advancing to step 2:
The number 159 fits into 40 0 times, leaving a remainder of 40.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 40 to get 40.
Grab the next digit (5) from the dividend, add it to 40, then carry on: 405 / 159

Advancing to step 3:
159 can be fit into 405 2 times, resulting in a remainder of 87.
Record the quotient 2 as the next digit in the result. 
Result so far: 2.0
If we subtract 318 from 405, we get 87.
Fetch the next digit (1) from the dividend, attach it to 87 and continue: 871 / 159

Going ahead to step 4:
159 can be fit into 871 5 times, resulting in a remainder of 76.
Write down 5 as next digit of the result. 
Result so far: 25.0
Deduct 795 from 871 and we're left with 76.
Fetch the next digit (8) from the dividend, attach it to 76 and continue: 768 / 159

Moving on to step 5:
The number 159 fits into 768 4 times, leaving a remainder of 132.
Write down 4 as next digit of the result. 
Result so far: 254.0
Deduct 636 from 768 and we're left with 132.
Bring next digit (0) of the dividend behind the 132 and repeat the process: 1320 / 159

Moving on to step 6:
The number 159 fits into 1320 8 times, leaving a remainder of 48.
Write down 8 as next digit of the result. 
Result so far: 2548.0
Subtract 1272 from 1320 to get 48.
Include the next digit (4) from the dividend after 48, then repeat: 484 / 159

Step 7:
159 goes into 484 3 times with a remainder of 7.
The next digit of our result is 3. 
Result so far: 25483.0
If we subtract 477 from 484, we get 7.
Fetch the next digit (2) from the dividend, attach it to 7 and continue: 72 / 159

Advancing to step 8:
159 can be fit into 72 0 times, resulting in a remainder of 72.
Record the quotient 0 as the next digit in the result. 
Result so far: 254830.0
Subtracting 0 from 72 leaves us with 72.
Since there are no more digits in the dividend, we add a zero to the remainder making it 720, and continue the process.

Step 9:
When dividing 720 by 159, we get 4 with a remainder of 84.
Use 4 as the next digit of our solution. 
Result so far: 254830.4
If we take 636 away from 720, we end up with 84.
Since there are no more digits in the dividend, we add a zero to the remainder making it 840, and continue the process.

Moving on to step 10:
If we divide 840 by 159, we get 5 and a remainder of 45.
The number 5 becomes the next digit in our result. 
Result so far: 254830.45
The remainder is 45 after subtracting 795 from 840.
Since there are no more digits in the dividend, we add a zero to the remainder making it 450, and continue the process.

On to step 11:
159 goes into 450 2 times with a remainder of 132.
The number 2 becomes the next digit in our result. 
Result so far: 254830.452
Subtracting 318 from 450 leaves us with 132.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1320, and continue the process.

Moving on to step 12:
159 goes into 1320 8 times with a remainder of 48.
Use 8 as the next digit of our solution. 
Result so far: 254830.4528
The remainder is 48 after subtracting 1272 from 1320.
Since there are no more digits in the dividend, we add a zero to the remainder making it 480, and continue the process.

On to step 13:
480 divided by 159 is 3 with a remainder of 3.
The number 3 becomes the next digit in our result. 
Result so far: 254830.45283
Deduct 477 from 480 and we're left with 3.
Since there are no more digits in the dividend, we add a zero to the remainder making it 30, and continue the process.

Going ahead to step 14:
30 divided by 159 is 0 with a remainder of 30.
The next digit of our result is 0. 
Result so far: 254830.45283
Subtract 0 from 30 to get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Moving on to step 15:
159 can be fit into 300 1 times, resulting in a remainder of 141.
Use 1 as the next digit of our solution. 
Result so far: 254830.4528301
Subtract 159 from 300 to get 141.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1410, and continue the process.

Advancing to step 16:
The number 159 fits into 1410 8 times, leaving a remainder of 138.
Use 8 as the next digit of our solution. 
Result so far: 254830.45283018
If we take 1272 away from 1410, we end up with 138.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1380, and continue the process.

The quotient of the division is 254830.45283018, and the remainder is 1.38e-07.