This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch Potential_cast_fix_for_4.1
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git

commit 4ca57efb3eaab300b6b66c64a3d377ef9f87c004
Author: Lee Rhodes <[email protected]>
AuthorDate: Mon Oct 23 19:36:02 2023 -0700

    Fix incorrect cast for 4.1
---
 .../java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java 
b/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java
index 996ce44c..da097c4c 100644
--- a/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java
+++ b/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java
@@ -96,7 +96,7 @@ public final class ItemsSketchSortedView<T> implements 
GenericSortedView<T> {
     if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     QuantilesUtil.checkNormalizedRankBounds(rank);
     final int len = cumWeights.length;
-    final long naturalRank = (int)(rank * totalN);
+    final long naturalRank = (long)(rank * totalN);
     final InequalitySearch crit = (searchCrit == INCLUSIVE) ? 
InequalitySearch.GE : InequalitySearch.GT;
     final int index = InequalitySearch.find(cumWeights, 0, len - 1, 
naturalRank, crit);
     if (index == -1) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to