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(final double num)
Round down given number.
final int floor = (int) num;
return (floor == num) ? floor : ((num > 0) ? floor : (floor - 1));
intfloor(final float val)
Faster floor function.
final int intVal = (int) val;
return val < 0 ? val == intVal ? intVal : intVal - 1 : intVal;
intfloor(final float x)
This method is a *lot* faster than using (int)Math.floor(x).
int y = (int) x;
if (x < 0 && x != y) {
    y--;
return y;
intfloor(float a)
Rounds the number down
return (int) a;
intfloor(float f)
floor
int i = (int) f;
return f >= (float) i ? i : i - 1;
intfloor(float f)
floor
boolean neg = f < 0;
int r = (int) f;
if (neg)
    r -= 1;
return r;
intfloor(float f)
Rounds the given number down to an int.
return (int) (f - f % 1f);
intfloor(float f)
Returns the first integer that is smaller than the given float.
int i = (int) f;
if (i > f)
    i--;
return i;
intfloor(float value)
Returns the largest integer less than or equal to the specified float.
return (int) (value + BIG_ENOUGH_FLOOR) - BIG_ENOUGH_INT;
intfloor(float value)
Returns the greatest integer less than or equal to the float argument
int i = (int) value;
return value < i ? i - 1 : i;