On Thu, 5 Feb 1998, seetho wrote: > Pasi T Mustalahti wrote: > > If this still give odd values, you can make even: > > TEMP = (TEMP + NV - TEMP/D) > > VAL =TEMP / D > > I get the running average first then the running total, I save on one divide > operation. PTM: If D= 2^n, you don't actually divide, you just shift right. That's only one instruction in any prosessor. This makes this Q&D -solution so beatifull. > > I've not implemented this Q&D solution (as you put it) yet. I'm not sure > whether it's going to work. PTM: I have used it myself. -------------------------------------------------------------------------- PTM, pasi.mustalahti@utu.fi, ptmusta@utu.fi, http://www.utu.fi/~ptmusta Lab.ins. (mikrotuki) ATK-keskus/Mat.Luon.Tdk OH1HEK Lab.engineer (PC support) Computer Center OI7234 Mail: Turun Yliopisto / Fysla, Vesilinnantie 5, 20014 Pt 02-3336669, FAX 02-3335632 (Pk 02-2387010, NMT 049-555577) --------------------------------------------------------------------------