-Added ICloneable and DeepClone to JToken
-Changed DeepEquals to take into account possible floating point errors
This commit is contained in:
@@ -124,5 +124,11 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
return Math.Max(val1.Value, val2.Value);
|
||||
}
|
||||
|
||||
public static bool ApproxEquals(double d1, double d2)
|
||||
{
|
||||
// are values equal to within 12 (or so) digits of precision?
|
||||
return Math.Abs(d1 - d2) < (Math.Abs(d1) * 1e-12);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user