Java Array Sum arraySum(final double input[])

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

Description

Calculates the sum of all array elements

License

Open Source License

Parameter

Parameter Description
input The input array

Return

The sum

Declaration

public static double arraySum(final double input[]) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  w  w w  .j a  va  2 s  .  co  m
     * Calculates the sum of all array elements
     * 
     * @param input The input array
     * @return The sum
     */
    public static double arraySum(final double input[]) {
        double sum = 0;
        for (double v : input)
            sum = sum + v;
        return sum;
    }
}

Related

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