From b5f51287f2efcd6d3eb19468fcf4762a682dff87 Mon Sep 17 00:00:00 2001 From: AlexandreHiroyuki Date: Tue, 11 Jun 2024 13:04:04 -0300 Subject: [PATCH] fix(DataTomeAnalysis): :ambulance: fix var method miscalculation --- src/DataTomeAnalysis.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DataTomeAnalysis.h b/src/DataTomeAnalysis.h index 4d39768..23b93d4 100644 --- a/src/DataTomeAnalysis.h +++ b/src/DataTomeAnalysis.h @@ -134,7 +134,7 @@ class DataTomeAnalysis : public DataTomeMvAvg { TypeOfArray var = 0; for (size_t i = 0; i < this->point_count(); i++) { TypeOfArray data_point = (*this)[i] - average; - var += (data_point - average) * (data_point - average); + var += (data_point) * (data_point); } return var; @@ -266,7 +266,7 @@ class DataTomeAnalysis : public DataTomeMvAvg { TypeOfArray var = 0; for (size_t i = 0; i < this->partial_point_count(partial_id); i++) { TypeOfArray data_point = (*this)[i] - average; - var += (data_point - average) * (data_point - average); + var += (data_point) * (data_point); } return var;