diff options
Diffstat (limited to 'sccomp')
-rw-r--r-- | sccomp/source/solver/SwarmSolver.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sccomp/source/solver/SwarmSolver.cxx b/sccomp/source/solver/SwarmSolver.cxx index dab7b648b8c0..2a549fb0e0a8 100644 --- a/sccomp/source/solver/SwarmSolver.cxx +++ b/sccomp/source/solver/SwarmSolver.cxx @@ -30,6 +30,7 @@ #include <comphelper/propertycontainer.hxx> #include <comphelper/proparrhlp.hxx> +#include <cmath> #include <vector> #include <limits> #include <chrono> @@ -370,7 +371,7 @@ double SwarmSolver::clampVariable(size_t nVarIndex, double fValue) double fResult = std::max(std::min(fValue, rBound.upper), rBound.lower); if (mbInteger) - return sal_Int64(fResult); + return std::trunc(fResult); return fResult; } @@ -389,7 +390,7 @@ double SwarmSolver::boundVariable(size_t nVarIndex, double fValue) } if (mbInteger) - return sal_Int64(fResult); + return std::trunc(fResult); return fResult; } |