summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-08 15:54:04 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-08 15:54:04 +0200
commit516c39e4003b179db0f9a777ce5df81c8041ef6b (patch)
treea5c846dc4dee6b1aa5254b651a86fe821e97c939 /tests
parent12242d27868e8361770ed1cfbfc958ab9084b81b (diff)
downloadsink-516c39e4003b179db0f9a777ce5df81c8041ef6b.tar.gz
sink-516c39e4003b179db0f9a777ce5df81c8041ef6b.zip
The variance of a single value is 0
Diffstat (limited to 'tests')
-rw-r--r--tests/dummyresourcewritebenchmark.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/dummyresourcewritebenchmark.cpp b/tests/dummyresourcewritebenchmark.cpp
index 2b71b4a..397e5de 100644
--- a/tests/dummyresourcewritebenchmark.cpp
+++ b/tests/dummyresourcewritebenchmark.cpp
@@ -27,6 +27,10 @@
27 27
28static double variance(const QList<double> &values) 28static double variance(const QList<double> &values)
29{ 29{
30 //The variance of a single value is 0
31 if (values.size() == 1) {
32 return 0;
33 }
30 double mean = 0; 34 double mean = 0;
31 for (auto value : values) { 35 for (auto value : values) {
32 mean += value; 36 mean += value;