code: public void setValue( int position, double value ) {
          if (position >= internalArray.length) {
              double[] newArray = new double[position + growingSize];
              System.arraycopy(internalArray, 0, newArray, 0, internalArray.length);
              internalArray = newArray;
          }
          internalArray[position] = value;
          lastIndex = max(lastIndex, position);
      }
docs: Safe set the value in a certain position.
  
  <p>If the array is smaller than the position, the array is extended and substituted.</p>
  
  @param position the index in which to set the value.
  @param value the value to set.