Java Utililty Methods floor

List of utility methods to do floor

Description

The list of methods to do floor are organized into topic(s).

Method

longfloorToLong(float pX)
floor To Long
return pX > 0 ? (long) pX : (long) pX - 1;
longfloorToNearestNumberDivisibleByFour(long number)
floor To Nearest Number Divisible By Four
return number & ~(0x3);
intfloorToPowerofTwo(int i)
floor To Powerof Two
int r = 1;
for (int c = 1; c <= i; c *= 2) {
    r = c;
return r;
intfloorTs(long timestamp, int aggregationWindow)
floor Ts
return (int) (timestamp / (1000 * aggregationWindow)) * aggregationWindow;
doublefloory(double a, double precision)
Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal for at least a precision value.
return Math.floor(a / precision) * precision;