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 2020/06/23 17:00:31 UTC

[commons-statistics] 04/35: Remove unreachable condition

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 acbdb89d739dd7582cb0db3d75efebcc10cbd52c
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Jun 23 12:26:58 2020 +0100

    Remove unreachable condition
    
    If degreesFreedom is not > 2 but it is > 1 then it must be <= 2.
---
 .../java/org/apache/commons/statistics/distribution/TDistribution.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
index e3babf5..ad7165d 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
@@ -54,7 +54,7 @@ public class TDistribution extends AbstractContinuousDistribution {
         mean = degreesOfFreedom > 1 ? 0 :
             Double.NaN;
         variance = degreesOfFreedom > 2 ? degreesOfFreedom / (degreesOfFreedom - 2) :
-            degreesOfFreedom > 1 && degreesOfFreedom <= 2 ? Double.POSITIVE_INFINITY :
+            degreesOfFreedom > 1 ? Double.POSITIVE_INFINITY :
             Double.NaN;
     }