AcTools.Utils.MathUtils.RoughlyEquals C# (CSharp) Метод

RoughlyEquals() публичный статический Метод

Checks if double is equal to another double considering another double’s precision. For example: RoughlyEquals(15.342, 15.34) → true; RoughlyEquals(15.34, 15.342) → false.
public static RoughlyEquals ( this value, double origin ) : bool
value this Value which will be compared
origin double Another value which will be compared and will define precision
Результат bool
        public static bool RoughlyEquals(this double value, double origin) {
            // Stupidest way. But if it works, is it so stupid? Yes, it is.
            var first = value.ToInvariantString();
            var second = origin.ToInvariantString();
            return first.Length > second.Length ? Equals(first.Substring(0, second.Length), second) : Equals(first, second);
        }