Here you can find the source of convertDoublesToFloats(double[] input)
Parameter | Description |
---|---|
input | a parameter |
public static float[] convertDoublesToFloats(double[] input)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j a v a 2 s.com*/ * converts a double array into a float array; USE WITH CAUTION as precision might be lost! * @param input * @return array with doubles */ public static float[] convertDoublesToFloats(double[] input) { if (input == null) { return null; } float[] output = new float[input.length]; for (int i = 0; i < input.length; i++) { output[i] = (float) input[i]; } return output; } }