Here you can find the source of sum(double[] a)
public final static double sum(double[] a)
//package com.java2s; public class Main { public final static int sum(int[] a) { int b = 0; for (int ii = 0; ii < a.length; ii++) { b += a[ii];/* w w w . jav a2 s .c o m*/ } return b; } public final static int sum(byte[] a) { int b = 0; for (int ii = 0; ii < a.length; ii++) { b += a[ii]; } return b; } public final static double sum(double[] a) { double b = 0; for (int ii = 0; ii < a.length; ii++) { b += a[ii]; } return b; } }