On Fri October 22 2010 10:11:38 KOSAKI Motohiro wrote:
You know more about this than me. I have no specific reason to use unsigned
int. I'll change it to unsigned long, if that's better.
Hmm, I guess that depends on the way you want to use it. In my case, most of
the times when I add a value to the average, I don't need to get the value.
I'd call ewma_add() many more times than ewma_get(). Having the functions
defined like this gives us the flexibility to choose and IMHO
ewma_get(ewma_add(&ewma, val)) isn't so bad?
bruno
--