Method AreClose
AreClose(double, double)
AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations only.
public static bool AreClose(double value1, double value2)
Parameters
Returns
- bool
bool - the result of the AreClose comparision.
AreClose(RectD, RectD)
Compares two rectangles for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
public static bool AreClose(RectD rect1, RectD rect2)
Parameters
Returns
- bool
Whether or not the two rectangles are equal
AreClose(SizeD, SizeD)
Compares two Size instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
public static bool AreClose(SizeD size1, SizeD size2)
Parameters
Returns
- bool
Whether or not the two Size instances are equal