namespace GeometriCS { /// /// Common utilities throughout the library. /// internal static class Utils { /// /// Default precision for double equality comparison. /// private const double DOUBLEPRECISION = 1E-5; /// /// Tests whether the difference between two doubles is within a given limit. /// /// First value to test. /// Second value to test. /// Maximum allowed difference. /// Do the values almost equal each other. public static bool DoubleEquals(double a, double b, double prec = DOUBLEPRECISION) => Math.Abs(a - b) <= prec; } }