You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/11/30 13:35:21 UTC
[commons-statistics] 05/15: Simplify comment
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git
commit 39d63218346d0633eeaa088744c1c39c01a1f368
Author: aherbert <ah...@apache.org>
AuthorDate: Wed Nov 30 11:51:29 2022 +0000
Simplify comment
---
.../statistics/distribution/AbstractDiscreteDistribution.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/AbstractDiscreteDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/AbstractDiscreteDistribution.java
index c2090c3..d5caf0d 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/AbstractDiscreteDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/AbstractDiscreteDistribution.java
@@ -219,10 +219,8 @@ abstract class AbstractDiscreteDistribution
long lower = lowerBound;
long upper = upperBound;
while (lower + 1 < upper) {
- // Cannot replace division by 2 with a right shift because (lower + upper)
- // can be negative. This can be optimized when we know that both
- // lower and upper arguments of this method are positive, for
- // example, for PoissonDistribution.
+ // Note: Cannot replace division by 2 with a right shift because
+ // (lower + upper) can be negative.
final long middle = (lower + upper) / 2;
final int pm = fun.applyAsInt((int) middle);
if (pm < 0) {