diff options
Diffstat (limited to 'include/adaptive.h')
-rw-r--r-- | include/adaptive.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/adaptive.h b/include/adaptive.h index 8902da5..360b13e 100644 --- a/include/adaptive.h +++ b/include/adaptive.h | |||
@@ -12,6 +12,12 @@ static inline fp_t f2fp(double f) | |||
12 | return (fp_t) {f * (1 << FP_SHIFT)}; | 12 | return (fp_t) {f * (1 << FP_SHIFT)}; |
13 | } | 13 | } |
14 | 14 | ||
15 | static inline double fp2f(fp_t f) | ||
16 | { | ||
17 | return ((double) f.val) / (1 << FP_SHIFT); | ||
18 | } | ||
19 | |||
20 | |||
15 | #define MAX_SERVICE_LEVELS 10 | 21 | #define MAX_SERVICE_LEVELS 10 |
16 | typedef struct { | 22 | typedef struct { |
17 | fp_t weight; | 23 | fp_t weight; |