I have a generic C# class comparer routine which reads values from objects and then compares their properties one by one using reflection.
var value1 = property.GetValue(object1, null);
var value2 = property.GetValue(object2, null);
if (!value1.Equals(value2))
{ ......
Thing is I'm getting differences in some of my float/double values that are insignificant and I want to ignore. What's the best way of implementing a specific test for floats/doubles (and potentially ints) that compares values based on a provided number of significant digits?