List of utility methods to do Double Number Round
long | RoundDown(final T number) Returns a long number by round down with specify number. Returns 0 if number == null. e.g: average is 3.5, then return 3. if (number == null) { return 0; return number.longValue(); |
int | roundDown(int n, int m) round Down while (n % m != 0) n--; return n; |
int | roundDown(int number, int mod) round Down return number / mod * mod;
|
int | roundDown(int val, int shift) Rounds an integer down to the nearest multiple of 2^shift . return val >>> shift << shift; |
int | roundDown(int val, int to) Round the value down to the closest value of to. int temp = val % to; if (temp < 3) { return val - temp; } else { return val + to - temp; |
int | roundDown(long n, long m) Round n down to nearest multiple of m. return (int) ((n / m) * m); |
long | roundDown(long size, long roundBoundary) round Down return (size - (size % roundBoundary));
|
long | roundDown(long val, long delta) round Down boolean isNegative = val < 0; val = Math.abs(val); val = val / delta * delta; return !isNegative ? val : -val; |
int | roundDownTo(int a, int quanta) round Down To return a & -quanta;
|
double | roundDownToNearest(double number, double nearest) round Down To Nearest return Math.floor(roundToPrecision(number / nearest, 10)) * nearest;
|