Hi Nigel, have I missed somthing? how can you get an average of a set of numbers when you are consecutivley adding a new value to a previous average and dividing by two?add two together, them divide the result by two (by right shifting). Then add the next number to that result, and divide by two again. Keep doing that until all the numbers are processed - the result is tha average of all the numbers.
I can see that bsodmike's latest idea works as long as he is working with even sets of figures in multiples of two and rotates accordingly, i.e. the next set of numbers he can multiply is 8, then 16 etc...
The way I approached averaging was to total all numbers and keep a tally of the divadend. The value of this tally would then be subtracted from the total until I reached zero. The number of divisions I make gives your average total. A small routine then rounds up or down depending on whether the final result hit zero or went negative.