Helper class for floating averages.
More...
#include <floatingaverage.h>
Helper class for floating averages.
Use add(new_value) to add a value (and get the the current average). average() returns the current average and sum() the total sum of stored values. Use setup() to setup place for "size" values.
◆ FloatingAverage() [1/2]
FloatingAverage::FloatingAverage |
( |
| ) |
|
◆ FloatingAverage() [2/2]
FloatingAverage::FloatingAverage |
( |
int |
size | ) |
|
|
inline |
◆ add()
double FloatingAverage::add |
( |
double |
add_value | ) |
|
add a value and return current average
◆ average()
double FloatingAverage::average |
( |
| ) |
const |
|
inline |
◆ setup()
void FloatingAverage::setup |
( |
const int |
size, |
|
|
const double |
InitValue = 0. |
|
) |
| |
◆ sum()
double FloatingAverage::sum |
( |
| ) |
const |
retrieve total sum of values.
The documentation for this class was generated from the following files: