public static bool operator <=(PrimitiveValue a, PrimitiveValue b) { INumber na = a as INumber; INumber nb = b as INumber; if (na != null && nb != null) { var r = na.Diff(nb); return(r <= 0); } return(false); }
public static bool TryCompare(PrimitiveValue a, PrimitiveValue b, out int delta) { INumber na = a as INumber; INumber nb = b as INumber; if (na != null && nb != null) { delta = na.Diff(nb); return(true); } delta = 0; return(false); }