MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getMinInBuffer

Method getMinInBuffer

libraries/RunningAverage/RunningAverage.cpp:103–116  ·  view source on GitHub ↗

returns the minimum value in the buffer

Source from the content-addressed store, hash-verified

101
102// returns the minimum value in the buffer
103float 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

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64