static double[] shortToDoubleArray(short[] a, int start, int end) { double[] b = new[end-start]; for (int i = start; i < end; i++) b[i-start] = a[i]; ret b; } static double[] shortToDoubleArray(short[] a, IntRange r) { ret shortToDoubleArray(a, r.start, r.end); }