Java Utililty Methods Float to Int

List of utility methods to do Float to Int

Description

The list of methods to do Float to Int are organized into topic(s).

Method

intfloatToInt(float f)
float To Int
int i = Math.round(f * 255);
return (i > 255) ? 255 : i;
intfloatToInt(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;
...
intfloatToInt(String flot)
float To Int
float m;
try {
    m = Float.parseFloat(flot);
} catch (Exception e) {
    return 0;
return (int) m;
IntegerfloatToInteger(final float value)
float To Integer
return (int) value;
intfloatToInteger(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;
...