Here you can find the source of toFloat(short[] arr)
Parameter | Description |
---|---|
arr | a short array |
public static float[] toFloat(short[] arr)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww . ja v a2s . c o m*/ * Converts an array of short values to an array of float values. Returns a new * array. * * @param arr a short array * @return a float array */ public static float[] toFloat(short[] arr) { int n = arr.length; float[] converted = new float[n]; for (int i = 0; i < n; i++) { converted[i] = arr[i]; } return converted; } /** * Converts an array of integer values to an array of float values. Returns a * new array. * * @param arr an integer array * @return a float array */ public static float[] toFloat(int[] arr) { int n = arr.length; float[] converted = new float[n]; for (int i = 0; i < n; i++) { converted[i] = arr[i]; } return converted; } }