Now *there's* a man who knows his maths! Ray Gardiner wrote: > I stand corrected, to use the simplified version you need to > keep the remainders of each division so that you can round > the result correctly. If I re-write as follows.... > X/3 = (X*256/4 + X*256/16 + X*256/64 + X*256/256 +128 )/256 > which becomes... > X/3 = (X*64 + X*16 + X*4 + X + 128)/256 > I think the rounding errors become minimal. (not proven) But I can see why they *do*. Common sense. We've been through this *all* before in the thread on basic digital filtering. Remember? > The interesting point (which I missed completely!) was that > with your method the rounding errors tend to cancel. Sheer accident as it happens! The rule is you only *ever*, *ever* drop the precision (by right- shifting to free space) when you don't want it, usually at the point of output (display). Accumulators *must* hold all intermediate precision. I just read (killed) a posting on another list talking of 16-bit DSP processors with 32-bit intermediate tally processing. Cheers, Paul B.