Java Array Length Get length(double[] v)

Here you can find the source of length(double[] v)

Description

length

License

Open Source License

Declaration

public static double length(double[] v) 

Method Source Code

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

public class Main {
    public static double length(double[] v) {
        return Math.sqrt(lengthSquare(v));
    }// www .  jav a 2 s .  c om

    public static double lengthSquare(double[] v) {
        double s = 0;
        for (double x : v) {
            s += x * x;
        }
        return s;
    }
}

Related

  1. arrayLength(Object[] ar)
  2. length(byte[] array)
  3. length(byte[] array)
  4. length(double[] a)
  5. length(double[] point)
  6. length(double[] x)
  7. length(final double[] a)
  8. length(final Object[] array)
  9. length(final T[]... arrays)