**Subject:** Stupid Q on prob Calculation

**To:** None *<tech-kern@netbsd.org>*

**From:** Sumantra Kundu *<sumantra@gmail.com>*

**List:** tech-kern

**Date:** 07/15/2006 10:39:50
Hi,
I am stuck at a very stupid point in calculating the
following probability inside the kernel. Here is what i need to do:
congestion prob = [{(a/b)* log (a/b)}/(log (b)] * (c/d).
a, b, are freq of invocations (integers) while c and d are time
difference (integers)
I know that its not possible to use floating point ops since the
kernel does not save FPU states (without messing up user
apps)...However, I do need **accurate** value of this quantity since
it basically estimates the degree of penalty of the process.. Prev. I
had used all ops which are multiples of 2 but this one has thrown be
off..Now, I am getting all zeros (rightly so) iside the kernel..
Any hints/suggestions on how shud I go around this? I looked in the
altq codes and most of them (ewma ) uses multiples of 2..
Regards,
Sumantra