diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-10 16:40:33 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-10 16:40:33 -0400 |
| commit | 889fac2bdf993dc86f64a8893c0260fdcf848acb (patch) | |
| tree | 99ed08552efa86fdc5fdf4ddb8720d10e599fafe /BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java | |
| parent | 1656b02144446aeedebb3d1179e07ed99c01861c (diff) | |
Cleanup
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java index 8a14d7d..770d3a5 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java @@ -18,15 +18,15 @@ public class NumberUtils { * The power to do the falling factorial for * @return The falling factorial of the number to the power */ - public static int fallingFactorial(int value, int power) { - if(power == 0) + public static int fallingFactorial(final int value, final int power) { + if (power == 0) return 1; - else if(power == 1) + else if (power == 1) return value; else { int result = 1; - for(int currentSub = 0; currentSub < power + 1; currentSub++) { + for (int currentSub = 0; currentSub < power + 1; currentSub++) { result *= value - currentSub; } @@ -45,25 +45,25 @@ public class NumberUtils { * The function to use to generate a random possibility * @return Whether or not a random possibility was a winning one */ - public static boolean isProbable(int winning, int total, Function<Integer, Integer> rng) { + public static boolean isProbable(final int winning, final int total, final Function<Integer, Integer> rng) { return rng.apply(total) < winning; } /** * Check if a number is in an inclusive range. - * + * * @param min * The minimum value of the range. - * + * * @param max * The maximum value of the range. - * + * * @param i * The number to check. - * + * * @return Whether the number is in the range. */ - public static boolean between(int min, int max, int i) { - return (i >= min) && (i <= max); + public static boolean between(final int min, final int max, final int i) { + return i >= min && i <= max; } } |
