Here you can find the source of arraySum(double[] a)
Parameter | Description |
---|---|
a | a parameter |
public static Double arraySum(double[] a)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . j a v a 2s . c om*/ * Sum up array * * @param a * @return */ public static Double arraySum(double[] a) { if (a == null) return 0.0; if (a.length == 0) return 0.0; double ret = 0.0; for (int i = 0; i < a.length; i++) { ret += a[i]; } return ret; } }