returns the minimum value in the buffer
| 101 | |
| 102 | // returns the minimum value in the buffer |
| 103 | float RunningAverage::getMinInBuffer() const |
| 104 | { |
| 105 | if (_count == 0) |
| 106 | { |
| 107 | return NAN; |
| 108 | } |
| 109 | |
| 110 | float _min = _array[0]; |
| 111 | for (uint16_t i = 1; i < _count; i++) |
| 112 | { |
| 113 | if (_array[i] < _min) _min = _array[i]; |
| 114 | } |
| 115 | return _min; |
| 116 | } |
| 117 | |
| 118 | |
| 119 | // returns the maximum value in the buffer |