This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/main by this push:
new 775d06a3db [SYSTEMDS-3833] Fix seq() length primitive (apply only when
violated)
775d06a3db is described below
commit 775d06a3dbbd5e48b4ad82c1884dd40aab06156b
Author: Matthias Boehm <[email protected]>
AuthorDate: Sun Feb 9 12:26:56 2025 +0100
[SYSTEMDS-3833] Fix seq() length primitive (apply only when violated)
---
src/main/java/org/apache/sysds/runtime/util/UtilFunctions.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sysds/runtime/util/UtilFunctions.java
b/src/main/java/org/apache/sysds/runtime/util/UtilFunctions.java
index e7d3c3f5b6..0530c0b6bc 100644
--- a/src/main/java/org/apache/sysds/runtime/util/UtilFunctions.java
+++ b/src/main/java/org/apache/sysds/runtime/util/UtilFunctions.java
@@ -447,8 +447,8 @@ public class UtilFunctions {
else
return 0; // invalid loop configuration
}
- long tmp = 1L + (long) Math.floor(to/incr - from/incr);
- return tmp + ((from+tmp*incr <= to) ? 1 : 0);
+ long tmp = (long) Math.floor(to/incr - from/incr);
+ return 1L + tmp + ((from+tmp*incr < to) ? 1 : 0);
}
/**