Extension method used to determine if two values are very close to equal, based on the Epsilon, the .NET defined potential error between equal floating point numbers.
public static bool AlmostEqual(this double left, double right)
parameter | description |
---|---|
left | First item to be compared. |
right | Second item to be compared. |
Returns true if left - right is less than or equal to Epsilon, and false otherwise.
- class MathExtensions
- namespace TheCodingMonkey.Math
Extension method used to determine if two values are very close to equal, based on the Epsilon, the .NET defined potential error between equal floating point numbers.
public static bool AlmostEqual(this float left, float right)
parameter | description |
---|---|
left | First item to be compared. |
right | Second item to be compared. |
Returns true if left - right is less than or equal to Epsilon, and false otherwise.
- class MathExtensions
- namespace TheCodingMonkey.Math
Extension method used to determine if two values are very close to equal, based on the specified precision, or error amount.
public static bool AlmostEqual(this decimal left, decimal right, decimal precision)
parameter | description |
---|---|
left | First item to be compared. |
right | Second item to be compared. |
precision | Amount of error allowed in the comparison. |
Returns true if left - right is less than or equal to precision, and false otherwise.
- class MathExtensions
- namespace TheCodingMonkey.Math
Extension method used to determine if two values are very close to equal, based on the specified precision, or error amount.
public static bool AlmostEqual(this double left, double right, double precision)
parameter | description |
---|---|
left | First item to be compared. |
right | Second item to be compared. |
precision | Amount of error allowed in the comparison. |
Returns true if left - right is less than or equal to precision, and false otherwise.
- class MathExtensions
- namespace TheCodingMonkey.Math
Extension method used to determine if two values are very close to equal, based on the specified precision, or error amount.
public static bool AlmostEqual(this float left, float right, float precision)
parameter | description |
---|---|
left | First item to be compared. |
right | Second item to be compared. |
precision | Amount of error allowed in the comparison. |
Returns true if left - right is less than or equal to precision, and false otherwise.
- class MathExtensions
- namespace TheCodingMonkey.Math