diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-06-02 12:12:47 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-06-02 12:12:47 +0200 |
commit | b12d6b2ecee0be03122a4bdba8ebbc91112fae3f (patch) | |
tree | 1bcc95eb0c26ffd1fbf23fab79f9ea80f26425b8 /shared/util.c | |
parent | 139651d45a72d57c5147e2854647d95cb87c9e4e (diff) |
dirc working
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); } |