summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table4.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 9403d1b913a7..09a17546c002 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -208,7 +208,8 @@ double approxDiff( double a, double b )
// tdf#129606: Limit precision to the 16th significant digit of the least precise argument.
// Cf. mnMaxGeneralPrecision in sc/source/core/data/column3.cxx.
const int nExpArg = static_cast<int>(floor(log10(std::max(aa, ab)))) - 15;
- return rtl::math::round(c, -std::max(nExp, nExpArg));
+ // Round the mean of the two subtractions
+ return rtl::math::round((c + d) / 2, -std::max(nExp, nExpArg));
}
}