RangeTCompare |
public int CompareTo( T other )
Value | meaning |
---|---|
Less than zero |
Both the Lower and Upper
members of this value are less than other - or - Both the Lower and Upper members of this value are less than or equal to other and IsUpperInclusive is false |
Zero | This instance is equal to or contains other |
Greater than zero |
Both the Lower and Upper
members of this value are greater than other - or - Both the Lower and Upper members of this value are greater than or equal to other and IsLowerInclusive is false |
var low = -1; var high = 1); var earlyToLate = new Range<int>(low, high); earlyToLate.CompareTo(0); --> 0 earlyToLate.CompareTo(low); --> 0 earlyToLate.CompareTo(low - 1); --> -1 earlyToLate.CompareTo(high); --> 0 earlyToLate.CompareTo(late + 1); --> 1