public override Range <T> LessThan(T value) { var newBound = BoundValue <T> .LowerBound(value); if (newBound < lower) { return(EmptyRange.Instance); } return(new SingleRange(lower, newBound.Min(upper))); }
public override Range <T> GreaterThanOrEquals(T value) { var newBound = BoundValue <T> .LowerBound(value); if (upper < newBound) { return(EmptyRange.Instance); } return(new SingleRange(newBound.Max(lower), upper)); }
public override bool Includes(T value) { return(lower <= BoundValue <T> .UpperBound(value) && BoundValue <T> .LowerBound(value) <= upper); }
public static SingleRange ThatLessThan(T value) { return(new SingleRange(BoundValue <T> .NegativeInfinity, BoundValue <T> .LowerBound(value))); }
public static SingleRange ThatGreaterThanOrEquals(T value) { return(new SingleRange(BoundValue <T> .LowerBound(value), BoundValue <T> .PositiveInfinity)); }