diff --git a/src/operator/Slice.cpp b/src/operator/Slice.cpp
index 070ea8c1991fa936a4f9421cad1b266f24fe87a2..7ae8cf872899180fc80c991d49922d2ceca744c9 100644
--- a/src/operator/Slice.cpp
+++ b/src/operator/Slice.cpp
@@ -152,7 +152,7 @@ bool Aidge::Slice_Op::forwardDims(bool /*allowDataDependency*/) {
             if(step == 0) {
                 AIDGE_THROW_OR_ABORT(std::runtime_error, "{}: Step must be a non-zero value", type());
             }
-            if(step * (end - start) < 0) {
+            if(step * (static_cast<int64_t>(end) - static_cast<int64_t>(start)) < 0) {
                 if(step < 0) {
                     AIDGE_THROW_OR_ABORT(std::runtime_error, "{}: Step is negative we must have End < Start", type());
                 }