using System; using System.Collections.Generic; namespace EvoCalculator.Core.Tests { public class DoubleArrayComparer : IEqualityComparer { private double _tolerance = 0.001; public DoubleArrayComparer(double tolerance) { this._tolerance = tolerance; } public DoubleArrayComparer() { } public bool Equals(double x, double y) { return Math.Abs(x - y) < _tolerance; } public int GetHashCode(double obj) { return obj.GetHashCode(); } } }