3 ms·
2. How is (c) better for calculating range size if you're using 1-based? 3. "But how do you have two adjacent ranges when they both have the same starting posi
by alentist 6y ago
2. How is (c) better for calculating range size if you're using 1-based?
3. "But how do you have two adjacent ranges when they both have the same starting position?" What do you mean?
Consider the length n prefix of a sequence. With 1-indexing, for n = 0, we have sequence[1:0], which means
a. The end position is before the start position (?!).
b. We have to use 0 anyway.
- Jtsummers 6y agoIn (c) with 1-based ranges the size of the range is present in the range. There is no calculating because the value is there. 1 <= x <= size One argument for the notation (not 0 vs 1 based ranges) is that notation (a) offers easier detection of adjacent ranges. This is irrelevant to the 0 and 1 based range debate.
- alentist 6y agoA range doesn’t have to start at 1.