List of utility methods to do floor
int | floor(final double num) Round down given number. final int floor = (int) num; return (floor == num) ? floor : ((num > 0) ? floor : (floor - 1)); |
int | floor(final float val) Faster floor function. final int intVal = (int) val; return val < 0 ? val == intVal ? intVal : intVal - 1 : intVal; |
int | floor(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; |
int | floor(float a) Rounds the number down return (int) a; |
int | floor(float f) floor int i = (int) f; return f >= (float) i ? i : i - 1; |
int | floor(float f) floor boolean neg = f < 0; int r = (int) f; if (neg) r -= 1; return r; |
int | floor(float f) Rounds the given number down to an int. return (int) (f - f % 1f); |
int | floor(float f) Returns the first integer that is smaller than the given float. int i = (int) f; if (i > f) i--; return i; |
int | floor(float value) Returns the largest integer less than or equal to the specified float. return (int) (value + BIG_ENOUGH_FLOOR) - BIG_ENOUGH_INT; |
int | floor(float value) Returns the greatest integer less than or equal to the float argument int i = (int) value; return value < i ? i - 1 : i; |