projects
/
platform
/
core
/
system
/
stability-monitor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c14481f
)
Prevent average from being less than zero
author
Konrad Kuchciak
<k.kuchciak@samsung.com>
Tue, 25 Jun 2019 06:29:55 +0000
(08:29 +0200)
committer
Konrad Kuchciak
<k.kuchciak@samsung.com>
Thu, 27 Jun 2019 11:38:14 +0000
(13:38 +0200)
I may happen due to floating point precision errors while adding and
subtracting the same values (very close to zero).
Change-Id: Id1201cb0bafd7386595c463d54b55c3fae3922ee
src/data_source.c
patch
|
blob
|
history
diff --git
a/src/data_source.c
b/src/data_source.c
index
e34ece6
..
180bc5a
100644
(file)
--- a/
src/data_source.c
+++ b/
src/data_source.c
@@
-81,6
+81,9
@@
int data_source_add_sample(struct data_source *ds, enum sample_type type,
}
}
+ if (sc->average < 0)
+ sc->average = 0;
+
return 0;
}