using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
}
}