mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 12:10:03 +02:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user