Java Float Array Create toFloats(double[] d)

Here you can find the source of toFloats(double[] d)

Description

to Floats

License

Open Source License

Declaration

public static float[] toFloats(double[] d) 

Method Source Code

//package com.java2s;
/** Ben F Rayfield offers this software opensource MIT license */

public class Main {
    public static float[] toFloats(double[] d) {
        float[] f = new float[d.length];
        for (int i = 0; i < f.length; i++)
            f[i] = (float) d[i];
        return f;
    }/*from   w  w w  .j  a va 2 s. c o m*/

    public static float[] toFloats(boolean[] b) {
        float[] f = new float[b.length];
        for (int i = 0; i < f.length; i++)
            f[i] = b[i] ? 1 : 0;
        return f;
    }
}

Related

  1. toFloatByObject(Object obj)
  2. toFloatMatrix(int[][] m)
  3. toFloatRawBits(int i)
  4. toFloats(byte[] bytes)
  5. toFloats(byte[] value, int offset, int num)
  6. toFloats(final double[] array)
  7. toFloats(Float[] values)
  8. toFloats(Object[] extraArgs)
  9. toFloats(String floatArray)