static void Main(string[] args) { //閉区間[6, 12] を生成 ClosedRange range = new ClosedRange(6, 12); // [3,8] の下端点は 3 int lowerEndpoint = range.getLowerEndpoint(); // => 6 // [6,12] の上端点は 8 int upperEndpoint = range.getUpperEndpoint(); // => 12 //1-1 System.Diagnostics.Debug.Print(lowerEndpoint.ToString()); System.Diagnostics.Debug.Print(upperEndpoint.ToString()); //1-2 System.Diagnostics.Debug.Print(range.toString()); }
public bool contains(ClosedRange closedRange) { return(v1 <= closedRange.v1 && v2 >= closedRange.v2); }
public bool equals(ClosedRange closedRange) { return(this.toString() == closedRange.toString()); }