summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:45:04 -0500
committerbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:45:04 -0500
commitdf94066e3af02ff02d5ab4d033a3d603f743234c (patch)
tree168a1edaf58d386c175ffb601e9d4da8e13d31e2 /base/src/main/java/bjc/utils/funcutils/NumberUtils.java
parentae51c587c53f7ca311e556e3cbd0c5566d6c2843 (diff)
Formatting pass
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/NumberUtils.java')
-rw-r--r--base/src/main/java/bjc/utils/funcutils/NumberUtils.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/NumberUtils.java b/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
index c3d52fa..c29fafe 100644
--- a/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
+++ b/base/src/main/java/bjc/utils/funcutils/NumberUtils.java
@@ -12,23 +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.
+ * @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;
}
@@ -40,13 +39,13 @@ 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.
*/
@@ -58,16 +57,15 @@ 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.
+ * @return Whether the number is in the range.
*/
public static boolean between(final int min, final int max, final int i) {
return i >= min && i <= max;