Since you are divisible by 2, and your numbers are not too small, this step should not affect the accuracy of the result. You simply subtract 14 from the exponent.
What is the number of bits in your samples.
Floats give you 24 bits of accuracy. If you have 2 ^ 14 = 16384 samples, then when you add them, you gradually lose accuracy until at some point it is lost after 24-14 = 10th bit. In other words: at this moment you save only 3 decimal digits.
Is it possible to use int as a battery or even uint? This way you save 8 extra bits, twice as much as the difference between 1024 and 16384 samples.
There is a second, completely different option. I donβt know what the range of your samples is, but if they are the same size, you can subtract the approximate average from each value, average the differences and add an approximate average result at the end.
How much you gain by this method depends on how good your initial approximation of the average value is and how close the values ββare to the average. Therefore, I would say that it is less reliable in your situation.
source share