public static IEnumerable <PeriodRange <T> > Slice(PeriodRange <T> range, uint size)
        {
            if (size == 0)
            {
                throw new ArgumentException("size must be positive number.");
            }
            var totalGap = ComparablePeriodUtil.GetGap(range.From, range.To);

            if (totalGap < 0)
            {
                throw new ArgumentOutOfRangeException($"given range is broken, from={range.From}, to={range.To}");
            }

            var cursor = range.From;
            var start  = cursor;

            for (uint num = 1; num <= (uint)totalGap; num++)
            {
                if (num % size == 0)
                {
                    yield return(Create(start, cursor));

                    cursor = (T)cursor.Next();
                    start  = cursor;
                }
                else
                {
                    cursor = (T)cursor.Next();
                }
            }
            // the last
            if (start.CompareTo(range.To) <= 0)
            {
                yield return(Create(start, range.To));
            }
        }
 public uint TotalGap() => (uint)ComparablePeriodUtil.GetGap(from, to);