code: public static double sum(Array array) throws ExpressionException {
  	if (array.getDimension() > 1) throw new ExpressionException("can only get sum/avg from 1 dimensional arrays");
  
  	double rtn = 0;
  	int len = array.size();
  	// try {
  	for (int i = 1; i <= len; i++) {
  	    rtn += _toDoubleValue(array, i);
  	}
  	/*
  	 * } catch (PageException e) { throw new
  	 * ExpressionException("exception while execute array operation: "+e.getMessage()); }
  	 */
  	return rtn;
      }
docs: sum of all values of a array, only work when all values are numeric
  
  @param array Array
  @return sum of all values
  @throws ExpressionException