code: int errorv(float[] a) {
          int best = best(a, 1);
          for (int k = 0; k < dim; k++) {
              a[k] = valuelist[best * dim + k];
          }
          return (best);
      }
docs: returns entry number and *modifies a* to the quantization value