Java Array Sum sum(double[] a)

Here you can find the source of sum(double[] a)

Description

sum

License

Open Source License

Declaration

public final static double sum(double[] a) 

Method Source Code

//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;
    }
}

Related

  1. sum(double a[], int begin, int end)
  2. sum(double values[], int size)
  3. sum(double... a)
  4. sum(double... values)
  5. sum(double... values)
  6. sum(double[] a)
  7. sum(double[] a, double[] b)
  8. sum(double[] a, double[] b)
  9. sum(double[] aArray)