Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

scaling floating point variables in the kernel

$
0
0

I am working to port the code of a packet scheduler from OMNet++ to Linux kernel.In the OMNet++ code there is a formula which calculates the average rate change:

avg_rate = avg_rate - alpha*(avg_rate - cur_rate)

alpha is a float variable that takes values from 0 to 1.

Since I cannot use floating point operations in the kernel, how can I scale this formula, or use an integer value for alpha?


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>