summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/interpr3.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index ae99d1a79ef6..f219beca9386 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -37,6 +37,7 @@
#include <vector>
#include <algorithm>
#include <comphelper/random.hxx>
+#include <o3tl/float_int_conversion.hxx>
#include <osl/diagnose.h>
#include <basegfx/numeric/ftools.hxx>
@@ -3656,7 +3657,7 @@ void ScInterpreter::CalculateSmallLarge(bool bSmall)
[](double f) {
f = rtl::math::approxFloor(f);
// Valid ranks are >= 1.
- if (f < 1.0 || static_cast<SCSIZE>(f) > std::numeric_limits<SCSIZE>::max())
+ if (f < 1.0 || !o3tl::convertsToAtMost(f, std::numeric_limits<SCSIZE>::max()))
return static_cast<SCSIZE>(0);
return static_cast<SCSIZE>(f);
});