Java Double Array Equal doubleArraysEqual(Double[] a, Double[] b, double tol)

Here you can find the source of doubleArraysEqual(Double[] a, Double[] b, double tol)

Description

double Arrays Equal

License

Open Source License

Declaration

public static boolean doubleArraysEqual(Double[] a, Double[] b,
            double tol) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean doubleArraysEqual(Double[] a, Double[] b,
            double tol) {

        if (a.length != b.length)
            return false;

        for (int i = 0; i < a.length; i++)
            if (Math.abs(a[i] - b[i]) > tol)
                return false;

        return true;
    }//  w  ww. j a v a 2 s . c  o  m
}

Related

  1. doubleArraysAreEqual(double array1[], double array2[])