Java Utililty Methods Double to Float

List of utility methods to do Double to Float

Description

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

Method

FloatdoubleToFloat(double d)
double To Float
if (d >= Float.MIN_VALUE && d <= Float.MAX_VALUE) {
    return (float) d;
return null;
float[]doubleToFloat(double[] array)
Convert a double array to a float array.
float[] farr = new float[array.length];
for (int i = 0; i < array.length; i++) {
    farr[i] = (float) array[i];
return farr;
float[]doubleToFloat(double[] array)
double To Float
float[] toReturn = new float[array.length];
for (int i = 0; i < array.length; ++i)
    toReturn[i] = (float) array[i];
return toReturn;
FloatdoubleToFloat(final double value)
double To Float
return (float) value;