3 ms·
With 1-based indexing, you can't index the last element of an array that occupies the entire domain of the index type.
by kevin_thibedeau 6y ago
With 1-based indexing, you can't index the last element of an array that occupies the entire domain of the index type.
- kzrdude 6y agoYou can't represent the length of that same array in the domain, which is normally enough to make this scenario unusable.
- gliptic 6y agoNot always, I've used bytes to store indexes to arrays of 256 elements. The length doesn't have to be the same narrow type as the indexes.
- josephg 6y agoSo? With 0-based indexing, the length of an array falls outside the domain of the index type. The number of times either of these properties has mattered for me also cannot be represented in the domain of 1-based indexes.
- deleted 6y ago[deleted]