From 932feffe012576e66f9500018422f305c718aa19 Mon Sep 17 00:00:00 2001 From: Dmitrij Naumov <dmitrij@naumov.de> Date: Sat, 20 Jul 2013 15:45:54 +0200 Subject: [PATCH] Use same precision as the rest of the algorithm. --- .../InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp b/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp index 9973b9470de..eb9d8631b4a 100644 --- a/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp +++ b/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp @@ -70,7 +70,7 @@ double PiecewiseLinearInterpolation::getValue(double pnt_to_interpolate) const } // compute linear interpolation polynom: y = m * (x - support[i]) + value[i] - const long double m((_values_at_supp_pnts[interval_idx + 1] - _values_at_supp_pnts[interval_idx]) + const double m((_values_at_supp_pnts[interval_idx + 1] - _values_at_supp_pnts[interval_idx]) / (_supp_pnts[interval_idx + 1] - _supp_pnts[interval_idx])); return m * (pnt_to_interpolate - _supp_pnts[interval_idx]) + _values_at_supp_pnts[interval_idx]; -- GitLab