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

intfloor(float x)
floor
return (int) (Math.floor(x) + 0.5f);
intfloor(int f)
floor
if ((f & 0xFFFF) == 0)
    return f;
return (f & ~0xFFFF) + (f < 0 ? 65536 : 0);
intfloor(int number, int divisor)
floor
return (number / divisor) * divisor;
intfloor(int x, int quantum)
Returns maximum possible integer, less or equal than oldValue, divisible by quantum.
int dx = (x > 0) || (x % quantum == 0) ? 0 : -1;
return (x / quantum + dx) * quantum;
doublefloor(Integer a)
Floor.
return Math.floor(a.doubleValue());
voidFloor(Object in, int val)
Floor
if (in == null)
    return;
if (in instanceof int[]) {
    int[] inn = (int[]) in;
    for (int i = 0, s = inn.length; i < s; i++)
        if (inn[i] < val)
            inn[i] = val;
} else {
...
Stringfloor(String input)
floor
Double d = Double.parseDouble(input);
return String.valueOf(Math.floor(d));
doublefloor10(double a)
Returns the largest (closest to positive infinity) double value that is a power of 10 not greater than the argument.
return Math.pow(10, Math.floor(log10(a)));
intfloor1e5(double coordinate)
floore
return (int) Math.floor(coordinate * 1e5);
intfloor2(int a, int preserveDigits)
Math#floor(double) -like operation for integers preserving the given number of digits in contrary to MathUtil#floor(int,int) where cut-of-digits are specified:
return floor(a, getDigits(a) - preserveDigits)
return floor(a, getDigits(a) - preserveDigits);