Java Array Sum sum(double[] xs)

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

Description

sum

License

Open Source License

Declaration

public static double sum(double[] xs) 

Method Source Code

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

public class Main {
    public static int sum(int[] xs) {
        int result = 0;
        for (int x : xs)
            result += x;/*from   w ww .  j  a  v  a2s. co m*/
        return result;
    }

    public static double sum(double[] xs) {
        double result = 0.0;
        for (double x : xs)
            result += x;
        return result;
    }
}

Related

  1. sum(double[] vec1, double[] vec2)
  2. sum(double[] vector)
  3. sum(double[] x)
  4. sum(double[] x, int length)
  5. sum(double[] x, int start, int end)
  6. sum(final byte[] array)
  7. sum(final double... values)
  8. sum(final double[] a)
  9. sum(final double[] arr)