Here you can find the source of almostEqual(double[][] a, double[][] b, double delta)
public static boolean almostEqual(double[][] a, double[][] b, double delta)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean almostEqual(double[][] a, double[][] b, double delta) { if (a.length != b.length) return false; boolean r = true; loop1: for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[i].length; j++) { double d = Math.abs((a[i][j] - b[i][j]) / b[i][j]); if (d > delta) { r = false;//from w w w . j a va2s . c o m break loop1; } } } return r; } }