Returns the sum of the portion of an array of numbers between
<code>fromIndex</code>, inclusive, and <code>toIndex</code>, exclusive.
Returns 0 if <code>fromIndex</code> &gt;= <code>toIndex</code>.
502846
public static double sum(double[] a, int fromIndex, int toIndex) {
    double result = 0.0;
    for (int i = fromIndex; i < toIndex; i++) {
      result += a[i];
    }
    return result;
  }
168784
public static Object getIndex(Object array, int index)
            throws UtilTargetError {
        Interpreter.debug("getIndex: ", array, ", index=", index);
        try {
            if ( array instanceof List )
                return ((List<?>) array).get(index);
            Object val = Array.get(array, index);
            return Primitive.wrap( val, Types.arrayElementType(array.getClass()) );
        } catch( IndexOutOfBoundsException e1 ) {
            int len = array instanceof List
                    ? ((List<?>) array).size()
                    : Array.getLength(array);
            throw new UtilTargetError("Index " + index
                    + " out-of-bounds for length " + len, e1);
        }
    }
1159219
function sum(arr) {
  var len = arr.length;
  var num = 0;
  while (len--) num += Number(arr[len]);
  return num;
}
641877
public NumberExpression<T> sum() {
        if (sum == null) {
            sum = Expressions.numberOperation(getType(), Ops.AggOps.SUM_AGG, mixin);
        }
        return sum;
    }
1265604
function getIndexOf(array, value, fromIndex) {
    var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result;
    return result;
  }
1254807
function getIntFromBuffer (buffer, start, end) {
  var sum = 0
  var sign = 1

  for (var i = start; i < end; i++) {
    var num = buffer[i]

    if (num < 58 && num >= 48) {
      sum = sum * 10 + (num - 48)
      continue
    }

    if (i === start && num === 43) { // +
      continue
    }

    if (i === start && num === 45) { // -
      sign = -1
      continue
    }

    if (num === 46) { // .
      // its a float. break here.
      break
    }

    throw new Error('not a number: buffer[' + i + '] = ' + num)
  }

  return sum * sign
}
377727
private static final int gatherIntLE(final byte[] data, final int index) {
        int i = data[index] & 0xFF;

        i |= (data[index + 1] & 0xFF) << 8;
        i |= (data[index + 2] & 0xFF) << 16;
        i |= (data[index + 3] << 24);

        return i;
    }
74709
public static Interval evensFromTo(int from, int to)
    {
        if (from % 2 != 0)
        {
            if (from < to)
            {
                from++;
            }
            else
            {
                from--;
            }
        }
        if (to % 2 != 0)
        {
            if (to > from)
            {
                to--;
            }
            else
            {
                to++;
            }
        }
        return Interval.fromToBy(from, to, to > from ? 2 : -2);
    }
1190146
public static int numPoints(INDArrayIndex... indexes) {
        int ret = 0;
        for (int i = 0; i < indexes.length; i++)
            if (indexes[i] instanceof PointIndex)
                ret++;
        return ret;
    }
627972
public static Object sum(Object[] self, Object initialValue) {
        return sum(toList(self), initialValue, false);
    }
972648
function indexOf(element, fromIndex) {
    /* jshint validthis:true */
    var arr = toArray(this),
        index;

    if (fromIndex) {
        arr = arr.slice(fromIndex);
    }

    index = binarySearch(arr, element, this.comparator);

    if (index < 0) {
        return -1;
    } else {
        return index;
    }
}
229242
private static int intFromSubArray(final byte[] bytes, final int from, final int to) {
    final byte[] subBytes = Arrays.copyOfRange(bytes, from, to);
    final ByteBuffer wrap = ByteBuffer.wrap(subBytes);
    return wrap.getInt();
  }
504936
public static int sum (int[] list)
    {
        int total = 0, lsize = list.length;
        for (int ii = 0; ii < lsize; ii++) {
            total += list[ii];
        }
        return total;
    }
268921
public static float sum (float zero, Iterable<? extends Number> values)
    {
        for (Number value : values) {
            zero += value.floatValue();
        }
        return zero;
    }
941518
def sum(self):
        
        return self.mapPartitions(lambda x: [sum(x)]).fold(0, operator.add)
1349820
private static void checkRange(int fromIndex, int toIndex) {
		if (fromIndex < 0)
			throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
		if (toIndex < 0)
			throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);
		if (fromIndex > toIndex)
			throw new IndexOutOfBoundsException("fromIndex: " + fromIndex +
					" > toIndex: " + toIndex);
	}
999244
function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
	    // convert -0 to +0
	    if (NEGATIVE_ZERO$1) return $native$1.apply(this, arguments) || 0;
	    var O = _toIobject(this);
	    var length = _toLength(O.length);
	    var index = length - 1;
	    if (arguments.length > 1) index = Math.min(index, _toInteger(arguments[1]));
	    if (index < 0) index = length + index;
	    for (; index >= 0; index--) {
	      if (index in O) if (O[index] === searchElement) return index || 0;
	    }return -1;
	  }