Adapted the accumulate function to return float.
This commit is contained in:
parent
b8f943e73c
commit
dece6c6bc8
|
@ -21,7 +21,7 @@ namespace Pinetime {
|
||||||
}
|
}
|
||||||
|
|
||||||
float GetAverage() const {
|
float GetAverage() const {
|
||||||
float sum = std::accumulate(arr.begin(), arr.end(), 0);
|
float sum = std::accumulate(arr.begin(), arr.end(), 0.0f);
|
||||||
return (sum / sz);
|
return (sum / sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ namespace Pinetime {
|
||||||
uint8_t cap;
|
uint8_t cap;
|
||||||
uint8_t loc;
|
uint8_t loc;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Battery {
|
class Battery {
|
||||||
public:
|
public:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
Loading…
Reference in a new issue