From f7911f4d36ca3aa4ea826cd12e1e3aa70cdf4b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 31 Mar 2017 17:05:54 +0200 Subject: [PATCH] [apps/statistics] Fix bug in quartile computation Change-Id: Ie5bbcf745b7a4f9766db1d3c39ca42d8489970da --- apps/statistics/store.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/statistics/store.cpp b/apps/statistics/store.cpp index a40ff98b1..a0c3e0668 100644 --- a/apps/statistics/store.cpp +++ b/apps/statistics/store.cpp @@ -133,12 +133,12 @@ float Store::standardDeviation() { } float Store::firstQuartile() { - int firstQuartileIndex = floorf(sumOfColumn(1)/4)+1; + int firstQuartileIndex = ceilf(sumOfColumn(1)/4); return sortedElementNumber(firstQuartileIndex); } float Store::thirdQuartile() { - int thirdQuartileIndex = floorf(3*sumOfColumn(1)/4)+1; + int thirdQuartileIndex = ceilf(3*sumOfColumn(1)/4); return sortedElementNumber(thirdQuartileIndex); }