Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
 public bool contains(ClosedRange closedRange)
 {
     return(v1 <= closedRange.v1 && v2 >= closedRange.v2);
 }
Ejemplo n.º 3
0
 public bool equals(ClosedRange closedRange)
 {
     return(this.toString() == closedRange.toString());
 }