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