List of utility methods to do Float to Int
int | floatToInt(float f) float To Int int i = Math.round(f * 255); return (i > 255) ? 255 : i; |
int | floatToInt(float f, int defaultValue) float To Int if (f >= Integer.MIN_VALUE && f <= Integer.MAX_VALUE) { return (int) f; return defaultValue; |
int[] | floatToInt(float[] ints) float To Int int size = ints.length; int[] valorInt = new int[size]; for (int i = 0; i < size; i++) { valorInt[i] = (int) ints[i]; return valorInt; |
int[] | floatToInt(float[] values) float To Int if (values == null) { return null; int[] results = new int[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (int) values[i]; return results; ... |
int | floatToInt(String flot) float To Int float m; try { m = Float.parseFloat(flot); } catch (Exception e) { return 0; return (int) m; |
Integer | floatToInteger(final float value) float To Integer return (int) value; |
int | floatToInteger(float f, float f2, float offset, boolean rotate) float To Integer if (rotate) { int i = (int) ((f2 - f) * 2 * offset); if (i > offset) { return i - (int) (2 * offset); } else if (i < -offset) { return i + (int) (2 * offset); } else { return i; ... |