Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MoyenneMobile by
Diff: MovingAverage.h
- Revision:
- 5:3521837ec075
- Parent:
- 4:0f6a72e290ad
diff -r 0f6a72e290ad -r 3521837ec075 MovingAverage.h --- a/MovingAverage.h Tue Sep 22 13:40:40 2015 +0000 +++ b/MovingAverage.h Tue Jan 05 09:48:13 2016 +0000 @@ -85,10 +85,11 @@ template<class T> void MovingAverage<T>::Insert(T value){ - Average = value/MaxLength + Average - Element[++NextElement]/MaxLength; + + Average = value/MaxLength + Average - Element[++NextElement]/MaxLength; Element[NextElement] = value; if(NextElement>=(MaxLength-1)) NextElement=0; - + } -#endif //MOVING_AVERAGE_H \ No newline at end of file +#endif //MOVING_AVERAGE_H