summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
diff options
context:
space:
mode:
authorBen Culkin <scorpress@gmail.com>2020-04-13 18:40:41 -0400
committerBen Culkin <scorpress@gmail.com>2020-04-13 18:40:41 -0400
commitd4ca769e542b2489b1e23cfcbdc3a0b7275b87cd (patch)
tree1653a7399f97fb0c63ce62e3f60fd830d5c37f70 /base/src/main/java/bjc/utils/funcutils/NumberUtils.java
parent2ac2e31a56ae59ee582e43a90c3495f86dd9ee7a (diff)
Cleanup pass
Cleanup pass to uniformize things
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/NumberUtils.java')
-rw-r--r--base/src/main/java/bjc/utils/funcutils/NumberUtils.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/NumberUtils.java b/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
index c29fafe..a5a046a 100644
--- a/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
+++ b/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
@@ -12,22 +12,22 @@ public class NumberUtils {
* Compute the falling factorial of a number.
*
* @param value
- * The number to compute.
+ * The number to compute.
*
* @param power
- * The power to do the falling factorial for.
+ * The power to do the falling factorial for.
*
* @return The falling factorial of the number to the power.
*/
public static int fallingFactorial(final int value, final int power) {
- if(power == 0) {
+ 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;
}
@@ -39,17 +39,18 @@ public class NumberUtils {
* Evaluates a linear probability distribution.
*
* @param winning
- * The number of winning possibilities.
+ * The number of winning possibilities.
*
* @param total
- * The number of total possibilities.
+ * The number of total possibilities.
*
* @param rng
- * The function to use to generate a random possibility.
+ * The function to use to generate a random possibility.
*
* @return Whether or not a random possibility was a winning one.
*/
- public static boolean isProbable(final int winning, final int total, final Function<Integer, Integer> rng) {
+ public static boolean isProbable(final int winning, final int total,
+ final Function<Integer, Integer> rng) {
return rng.apply(total) < winning;
}
@@ -57,13 +58,13 @@ public class NumberUtils {
* Check if a number is in an inclusive range.
*
* @param min
- * The minimum value of the range.
+ * The minimum value of the range.
*
* @param max
- * The maximum value of the range.
+ * The maximum value of the range.
*
* @param i
- * The number to check.
+ * The number to check.
*
* @return Whether the number is in the range.
*/