summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2021-05-07 13:19:51 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-08 09:03:05 +0200
commite5750bacf680177447134ca6409967ed4b00e434 (patch)
tree5cf21ac98606c9901443cdb12fcea1746b8eea8b /sc/source/core
parent5545d8f515a2f7af45f0d2ab3ee40dfbde7fa20f (diff)
Review of the code affected by KahanSum
Change-Id: I96fd479eeae287ef5c7a8615856631d4ba9b02f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115238 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/tool/interpr2.cxx2
-rw-r--r--sc/source/core/tool/interpr3.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 8f2e4ed9a257..dc30df4be07e 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1735,7 +1735,7 @@ void ScInterpreter::ScDB()
fSumOffRate += fDb;
}
if (fPeriod > fLife)
- fDb = (-(fSumOffRate - fCost).get() * fOffRate * (12.0 - fMonths)) / 12.0;
+ fDb = -(fSumOffRate - fCost).get() * fOffRate * (12.0 - fMonths) / 12.0;
}
PushDouble(fDb);
}
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index bc4265be0b67..3354488a88e4 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -4609,8 +4609,8 @@ void ScInterpreter::CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _b
|| (!_bStexy && fSumSqrDeltaY < ::std::numeric_limits<double>::min()))
PushError( FormulaError::DivisionByZero);
else if ( _bStexy )
- PushDouble( sqrt( ( fSumSqrDeltaY - fSumDeltaXDeltaY.get() *
- fSumDeltaXDeltaY.get() / fSumSqrDeltaX.get() ).get() / (fCount-2)));
+ PushDouble( sqrt( ( fSumSqrDeltaY - fSumDeltaXDeltaY *
+ fSumDeltaXDeltaY / fSumSqrDeltaX ).get() / (fCount-2)));
else
PushDouble( fSumDeltaXDeltaY.get() / sqrt( fSumSqrDeltaX.get() * fSumSqrDeltaY.get() ));
}