code: public int indexOfFromTo(double element, int from, int to) {
  	// overridden for performance only.
  	if (size==0) return -1;
  	checkRangeFromTo(from, to, size);
  
  	double[] theElements = elements;
  	for (int i = from ; i <= to; i++) {
  	    if (element==theElements[i]) {return i;} //found
  	}
  	return -1; //not found
  }
docs: Returns the index of the first occurrence of the specified
  element. Returns <code>-1</code> if the receiver does not contain this element.
  Searches between <code>from</code>, inclusive and <code>to</code>, inclusive.
  Tests for identity.
  
  @param element element to search for.
  @param from the leftmost search position, inclusive.
  @param to the rightmost search position, inclusive.
  @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).