]> source.dussan.org Git - poi.git/commitdiff
increase intermediate significance
authorPJ Fanning <fanningpj@apache.org>
Sat, 14 Aug 2021 09:54:11 +0000 (09:54 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 14 Aug 2021 09:54:11 +0000 (09:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892333 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/ss/formula/atp/PercentRankExcFunction.java

index 7968ed13f2463506bb8ebe2b8afe3ef62372287a..89e7c1e76e805e3a29150c22aee772196d30f5e5 100644 (file)
@@ -137,11 +137,12 @@ final class PercentRankExcFunction implements FreeRefFunction {
             BigDecimal result = new BigDecimal((double)(lessThanCount + 1) / (double)(numbers.size() + 1));
             return new NumberEval(PercentRank.round(result, significance));
         } else {
-            ValueEval belowRank = calculateRank(numbers, closestMatchBelow, significance + 3, false);
+            int intermediateSignificance = significance < 5 ? 8 : significance + 3;
+            ValueEval belowRank = calculateRank(numbers, closestMatchBelow, intermediateSignificance, false);
             if (!(belowRank instanceof NumberEval)) {
                 return belowRank;
             }
-            ValueEval aboveRank = calculateRank(numbers, closestMatchAbove, significance + 3, false);
+            ValueEval aboveRank = calculateRank(numbers, closestMatchAbove, intermediateSignificance, false);
             if (!(aboveRank instanceof NumberEval)) {
                 return aboveRank;
             }