code: int encodevs(float[] a, Buffer b, int step, int addmul) {
          int best = besterror(a, step, addmul);
          return (encode(best, b));
      }
docs: returns the number of bits and *modifies a* to the remainder value