code: public static double[] toDouble(int[] array) {
      double[] rv = new double[array.length];
      for (int i = 0; i < array.length; i++) {
        rv[i] = array[i];
      }
      return rv;
    }
docs: Casts to a double array.