Java Double Array Equal doubleArraysAreEqual(double array1[], double array2[])

Here you can find the source of doubleArraysAreEqual(double array1[], double array2[])

Description

Test if two double arrays are equal.

License

Open Source License

Declaration

public static boolean doubleArraysAreEqual(double array1[],
        double array2[]) 

Method Source Code

//package com.java2s;
//   it under the terms of the GNU General Public License as published by

public class Main {
    /**/*w  w  w.  j av  a  2  s  . c om*/
     * Test if two double arrays are equal.
     */
    public static boolean doubleArraysAreEqual(double array1[],
            double array2[]) {
        int i, n;
        if (array1 == null)
            return (array2 == null);
        n = array1.length;
        if (n != array2.length)
            return false;
        for (i = 0; i < n; i++) {
            if (array1[i] != array2[i])
                return false;
            ;
        }
        return true;
    }
}

Related

  1. doubleArraysEqual(Double[] a, Double[] b, double tol)