Skip to content

Commit 775d06a

Browse files
committed
[SYSTEMDS-3833] Fix seq() length primitive (apply only when violated)
1 parent 417bf3e commit 775d06a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/apache/sysds/runtime/util/UtilFunctions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ public static long getSeqLength(double from, double to, double incr, boolean che
447447
else
448448
return 0; // invalid loop configuration
449449
}
450-
long tmp = 1L + (long) Math.floor(to/incr - from/incr);
451-
return tmp + ((from+tmp*incr <= to) ? 1 : 0);
450+
long tmp = (long) Math.floor(to/incr - from/incr);
451+
return 1L + tmp + ((from+tmp*incr < to) ? 1 : 0);
452452
}
453453

454454
/**

0 commit comments

Comments
 (0)