We're dividing 40246378 by 8 
The aim is to understand the frequency of 8 in 40246378.

Going ahead to step 1:
8 goes into 4 0 times with a remainder of 4.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Deduct 0 from 4 and we're left with 4.
Fetch the next digit (0) from the dividend, attach it to 4 and continue: 40 / 8

On to step 2:
The number 8 fits into 40 5 times, leaving a remainder of 0.
Put 5 as the next digit of the answer. 
Result so far: 5.0
If we subtract 40 from 40, we get 0.
Take the next digit (2) from the dividend and append it to 0, then repeat: 2 / 8

Going ahead to step 3:
2 divided by 8 is 0 with a remainder of 2.
Record the quotient 0 as the next digit in the result. 
Result so far: 50.0
Subtracting 0 from 2 leaves us with 2.
Fetch the next digit (4) from the dividend, attach it to 2 and continue: 24 / 8

Let's proceed to step 4:
24 divided by 8 is 3 with a remainder of 0.
Record the quotient 3 as the next digit in the result. 
Result so far: 503.0
If we take 24 away from 24, we end up with 0.
Include the next digit (6) from the dividend after 0, then repeat: 6 / 8

Advancing to step 5:
8 goes into 6 0 times with a remainder of 6.
The next digit of our result is 0. 
Result so far: 5030.0
Subtracting 0 from 6 leaves us with 6.
Grab the next digit (3) from the dividend, add it to 6, then carry on: 63 / 8

Advancing to step 6:
If we divide 63 by 8, we get 7 and a remainder of 7.
Record the quotient 7 as the next digit in the result. 
Result so far: 50307.0
If we subtract 56 from 63, we get 7.
Append the next digit (7) from the dividend to 7 and continue with: 77 / 8

Advancing to step 7:
8 can be fit into 77 9 times, resulting in a remainder of 5.
The number 9 becomes the next digit in our result. 
Result so far: 503079.0
Subtracting 72 from 77 leaves us with 5.
Fetch the next digit (8) from the dividend, attach it to 5 and continue: 58 / 8

Let's proceed to step 8:
8 goes into 58 7 times with a remainder of 2.
Put 7 as the next digit of the answer. 
Result so far: 5030797.0
Subtracting 56 from 58 leaves us with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

On to step 9:
If we divide 20 by 8, we get 2 and a remainder of 4.
Use 2 as the next digit of our solution. 
Result so far: 5030797.2
If we take 16 away from 20, we end up with 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

On to step 10:
40 divided by 8 is 5 with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 5030797.25
Deduct 40 from 40 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.

Step 11:
When dividing 0 by 8, we get 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 5030797.25
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.

On to step 12:
0 divided by 8 is 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 5030797.25
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.

The final result is 5030797.25 with a remainder of 0.0.