Here you can find the source of toFloats(double[] d)
public static float[] toFloats(double[] d)
//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; } }