List of utility methods to do floor
int | floor_double(double a) Helper function for createNewPlayer int b = (int) a; return a >= (double) b ? b : b - 1; |
int | floor_double(double value) Returns the greatest integer less than or equal to the double argument int i = (int) value; return value < (double) i ? i - 1 : i; |
long | floor_double_long(double d) floodoubllong long l = (long) d; return d >= (double) l ? l : l - 1L; |
int | floor_float(float f) floofloat int i = (int) f; return f >= i ? i : i - 1; |
int | floorAndCrop(final double x, final int min, final int max) First calls Math.floor with x and then crops the resulting value to the range min to max .
final int rx = floorInt(x); return crop(rx, min, max); |
void | floorData(float[] data, float floor) If a data point is below 'floor' make it equal to floor. for (int i = 0; i < data.length; i++) { if (data[i] < floor) { data[i] = floor; |
long | floorDay(long milli) floor Day return milli - milli % DAY_IN_MILLIS;
|
int | floorDiv(final int x, final int y) floor Div int r = x / y; if ((x ^ y) < 0 && (r * y != x)) { r--; return r; |
int | floorDiv(int dividend, int divisor) Computes floored division. return (int) Math.floor((double) dividend / (double) divisor); |
int | floorDiv(int dividend, int divisor) Computes the floored division dividend/divisor which is useful when dividing potentially negative numbers into bins. boolean numpos = dividend >= 0, denpos = divisor >= 0; if (numpos == denpos) return dividend / divisor; return denpos ? (dividend - divisor + 1) / divisor : (dividend - divisor - 1) / divisor; |