public class MathUtils
extends java.lang.Object
| Constructor and Description |
|---|
MathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
cap(int i,
int cap)
Deprecated.
use
Math.min(int, int) instead. |
static long |
cap(long i,
long cap)
Deprecated.
use
Math.min(long, long) instead. |
static double |
capLower(double i,
double lowerCap)
caps a value by the given minimum value.
|
static int |
capLower(int i,
int lowerCap)
Deprecated.
use
Math.max(int, int) instead |
static int |
constrainWithin(int i,
int lower,
double upper)
contrains a value within the given lower and upper boundaries
|
static int |
constrainWithin(int i,
int lower,
int upper)
contrains a value within the given lower and upper boundaries
|
static double |
getSumOf(double[] in)
sums up the values in the array and returns the sum
|
static int |
getSumOf(int[] in)
sums up the values in the array and returns the sum
|
static int |
min(int... arguments)
finds the minimum value from a given array of integer values
|
static int |
numberOfDigits(int i) |
static int |
numberOfDigits(long i) |
public static int min(int... arguments)
public static final int constrainWithin(int i,
int lower,
int upper)
public static int constrainWithin(int i,
int lower,
double upper)
@Deprecated
public static final int cap(int i,
int cap)
Math.min(int, int) instead.@Deprecated
public static final int capLower(int i,
int lowerCap)
Math.max(int, int) insteadpublic static double capLower(double i,
double lowerCap)
@Deprecated
public static final long cap(long i,
long cap)
Math.min(long, long) instead.public static double getSumOf(double[] in)
in - the array over which the sum shall be calculatedpublic static int getSumOf(int[] in)
in - the array over which the sum shall be calculatedpublic static int numberOfDigits(int i)
public static int numberOfDigits(long i)