diff options
Diffstat (limited to 'shared/util.c')
-rw-r--r-- | shared/util.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/shared/util.c b/shared/util.c index 55f3491..68503e8 100644 --- a/shared/util.c +++ b/shared/util.c @@ -4,3 +4,5 @@ unsigned long w2_util_exp_mov_avg(unsigned long current_avg, unsigned long new_m return (unsigned long)((((double)(current_avg)) * ((double)(1.f - W2_EMA_WEIGHT))) + (((double)(new_meas)) * ((double)(W2_EMA_WEIGHT)))); } + +int w2_sign(int n) { return (n > 0) - (n < 0); } |