Here you can find the source of sum(double[] x, int length)
public static double sum(double[] x, int length)
//package com.java2s; //License from project: BSD License public class Main { public static double sum(double[] x, int length) { double s = 0; for (int i = 0; i < length; i++) s += x[i];/*from w w w . j a v a 2s . c o m*/ return s; } public static double sum(double[] x) { return sum(x, x.length); } public static int sum(int[] x, int length) { int s = 0; for (int i = 0; i < length; i++) s += x[i]; return s; } public static double sum(int[] x) { return sum(x, x.length); } }