Here you can find the source of toFloat(double[] v)
public static float[] toFloat(double[] v)
//package com.java2s; //License from project: Open Source License public class Main { public static float[] toFloat(double[] v) { final float[] ans = new float[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (float) v[k]; return (ans); }// ww w . ja v a 2 s. c o m public static float[] toFloat(long[] v) { final float[] ans = new float[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (float) v[k]; return (ans); } public static float[] toFloat(int[] v) { final float[] ans = new float[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (float) v[k]; return (ans); } public static float[][] toFloat(double[][] v) { final float[][] ans = new float[v.length][]; for (int k = 0; k < v.length; k++) ans[k] = toFloat(v[k]); return (ans); } public static float[][] toFloat(long[][] v) { final float[][] ans = new float[v.length][]; for (int k = 0; k < v.length; k++) ans[k] = toFloat(v[k]); return (ans); } public static float[][] toFloat(int[][] v) { final float[][] ans = new float[v.length][]; for (int k = 0; k < v.length; k++) ans[k] = toFloat(v[k]); return (ans); } }