code: public static double[] pow(double[] x, double n) {
          double[] array = new double[x.length];
          for (int i = 0; i < x.length; i++) {
              array[i] = Math.pow(x[i], n);
          }
          return array;
      }
docs: Raise each element of an array to a scalar power.
  @param x array
  @param n scalar exponent
  @return x<sup>n</sup>