using System;
namespace API.Extensions;
public static class DoubleExtensions
{
    private const float Tolerance = 0.001f;
    /// 
    /// Used to compare 2 floats together
    /// 
    /// 
    /// 
    /// 
    public static bool Is(this double a, double? b)
    {
        if (!b.HasValue) return false;
        return Math.Abs((float) (a - b)) < Tolerance;
    }
    public static bool IsNot(this double a, double? b)
    {
        if (!b.HasValue) return false;
        return Math.Abs((float) (a - b)) > Tolerance;
    }
}