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 b8efed505f150c83647d06e822b89047b4035504
Author: Alex Herbert <[email protected]>
AuthorDate: Tue Aug 25 14:29:05 2026 +0100

    Move variable declaration position
---
 .../statistics/inference/KolmogorovSmirnovDistribution.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
 
b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
index ce7cbbfa..4074b99a 100644
--- 
a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
+++ 
b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
@@ -547,10 +547,6 @@ final class KolmogorovSmirnovDistribution {
             // This is the form for K0.
             // Compute all together over odd integers and divide factors
             // of (k + 1/2)^b by 2^b.
-            double k0 = 0;
-            double k1 = 0;
-            double k2 = 0;
-            double k3 = 0;
 
             final double rootN = Math.sqrt(n);
             final double z = x * rootN;
@@ -580,6 +576,10 @@ final class KolmogorovSmirnovDistribution {
             // Solve using quadratic equation and eps = ulp(1.0): 4a ~ -288
             final int max = (int) Math.ceil((1 + Math.sqrt(1 - FOUR_A * z2 / 
PI2)) / 2);
             // Sum smallest terms first
+            double k0 = 0;
+            double k1 = 0;
+            double k2 = 0;
+            double k3 = 0;
             for (int k = max; k > 0; k--) {
                 final int j = 2 * k - 1;
                 // Create (2k-1)^2; (2k-1)^4; (2k-1)^6

Reply via email to