Java Array Sum arraySum(double[] arr)

Here you can find the source of arraySum(double[] arr)

Description

array Sum

License

Apache License

Declaration

public static double arraySum(double[] arr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double arraySum(double[] arr) {
        double sum = 0;
        for (double num : arr) {
            sum += num;/*from ww  w.  j a va2  s  . c  o  m*/
        }
        return sum;
    }

    public static float arraySum(float[] arr) {
        float sum = 0;
        for (float num : arr) {
            sum += num;
        }
        return sum;
    }
}

Related

  1. arrayAdd(int[] sumFreq, int[] freq)
  2. ArrayCeilSum(float[] a)
  3. arraySum(double[] a)
  4. arraySum(final double input[])
  5. ArraySum(float[] a)
  6. arraySum(int[] intArray, short flag)
  7. getSum(int[] array)