Skip to content

Commit

Permalink
#173: fixed clang format issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitryP6 committed Nov 17, 2024
1 parent 2f4449d commit be7ef9a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: local
hooks:
- id: clang_restage
name: Restage formatted files
entry: clang_restage
language: system
pass_filenames: false
always_run: true
repos:
- repo: local
hooks:
- id: clang_restage
name: Restage formatted files
entry: clang_restage
language: system
pass_filenames: false
always_run: true
stages: [pre-commit]
29 changes: 16 additions & 13 deletions simple_ema.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#include <stdio.h>

// Exponential Moving Average Lowpass Filter
void ema_filter(float current_value, float *previous_ema, float alpha) {
*previous_ema = (alpha * current_value) + ((1 - alpha) * (*previous_ema));
}

int main() {
float alpha = 0.1f; // smoothing strength
float ema = 0.0f; // initial value can be 0
// Something like : ema_filter(curent_unfiltered_value, &ema, alpha)
return 0;
}
#include <stdio.h>

// Exponential Moving Average Lowpass Filter
void ema_filter(float current_value, float *previous_ema, float alpha)
{
*previous_ema =
(alpha * current_value) + ((1 - alpha) * (*previous_ema));
}

int main()
{
float alpha = 0.1f; // smoothing strength
float ema = 0.0f; // initial value can be 0
// Something like : ema_filter(curent_unfiltered_value, &ema, alpha)
return 0;
}

0 comments on commit be7ef9a

Please sign in to comment.