Here you can find the source of doubleToFloat(double[] array)
Parameter | Description |
---|---|
array | array of doubles to convert |
public static float[] doubleToFloat(double[] array)
//package com.java2s; public class Main { /**//w w w .ja v a2s.c o m * Convert a double array to a float array. * @param array array of doubles to convert * @return array of floats */ public static float[] doubleToFloat(double[] array) { float[] farr = new float[array.length]; for (int i = 0; i < array.length; i++) { farr[i] = (float) array[i]; } return farr; } }