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 2019/11/09 08:49:34 UTC

[commons-numbers] branch master updated (bd83bb0 -> 3be2377)

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

aherbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git.


    from bd83bb0  checkstyle:check and pmd:check to log violations to console.
     new 886b6ae  Use final.
     new 3be2377  Use final.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/commons/numbers/arrays/SafeNorm.java   | 14 +++++++-------
 .../commons/numbers/combinatorics/FactorialDouble.java     |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)


[commons-numbers] 02/02: Use final.

Posted by ah...@apache.org.
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-numbers.git

commit 3be23775678979d05cf5dc9b94e143af0f12c8f8
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Nov 9 08:49:30 2019 +0000

    Use final.
---
 .../org/apache/commons/numbers/combinatorics/FactorialDouble.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/FactorialDouble.java b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/FactorialDouble.java
index 154be52..32cd5d1 100644
--- a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/FactorialDouble.java
+++ b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/FactorialDouble.java
@@ -48,8 +48,8 @@ public final class FactorialDouble {
 
         factorialsDouble = new double[numValues];
         // Initialize first two entries.
-        for (int i = 0, max = numValues < 2 ? numValues : 2;
-             i < max; i++) {
+        final int max = numValues < 2 ? numValues : 2;
+        for (int i = 0; i < max; i++) {
             factorialsDouble[i] = 1;
         }
 


[commons-numbers] 01/02: Use final.

Posted by ah...@apache.org.
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-numbers.git

commit 886b6aefbb9dfdcd53214d26777170a91d480c21
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Nov 9 08:46:19 2019 +0000

    Use final.
---
 .../java/org/apache/commons/numbers/arrays/SafeNorm.java   | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SafeNorm.java b/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SafeNorm.java
index e7fcf7e..0656bd6 100644
--- a/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SafeNorm.java
+++ b/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SafeNorm.java
@@ -42,28 +42,28 @@ public final class SafeNorm {
         double s3 = 0;
         double x1max = 0;
         double x3max = 0;
-        double floatn = v.length;
-        double agiant = R_GIANT / floatn;
+        final double floatn = v.length;
+        final double agiant = R_GIANT / floatn;
         for (int i = 0; i < v.length; i++) {
-            double xabs = Math.abs(v[i]);
+            final double xabs = Math.abs(v[i]);
             if (xabs < R_DWARF || xabs > agiant) {
                 if (xabs > R_DWARF) {
                     if (xabs > x1max) {
-                        double r = x1max / xabs;
+                        final double r = x1max / xabs;
                         s1 = 1 + s1 * r * r;
                         x1max = xabs;
                     } else {
-                        double r = xabs / x1max;
+                        final double r = xabs / x1max;
                         s1 += r * r;
                     }
                 } else {
                     if (xabs > x3max) {
-                        double r = x3max / xabs;
+                        final double r = x3max / xabs;
                         s3 = 1 + s3 * r * r;
                         x3max = xabs;
                     } else {
                         if (xabs != 0) {
-                            double r = xabs / x3max;
+                            final double r = xabs / x3max;
                             s3 += r * r;
                         }
                     }