[apps/statistics] Simplify histogram controller and resolve bugs: with

very large values, casting in float gives approximate values that
trigger bugs

Change-Id: I5aac31ad07f267f1b96ee3406b041e527cf247ba
This commit is contained in:
Émilie Feral
2017-08-25 16:37:13 +02:00
parent b893a7d0aa
commit ff8fe2b498
5 changed files with 41 additions and 44 deletions

View File

@@ -3,6 +3,7 @@
#include "../apps_container.h"
#include "../constant.h"
#include <assert.h>
#include <float.h>
#include <cmath>
using namespace Shared;
@@ -34,6 +35,9 @@ HighlightCell * StoreController::titleCells(int index) {
}
bool StoreController::setDataAtLocation(double floatBody, int columnIndex, int rowIndex) {
if (std::fabs(floatBody) > FLT_MAX) {
return false;
}
if (columnIndex == 1) {
if (floatBody < 0) {
return false;