3 ms·
I was going to say because it starts array indexes at 1.
by dhagz 6y ago
I was going to say because it starts array indexes at 1.
- snicker7 6y agoMost "scientific" languages have indexes starting in 1 and/or configurable (R, Julia, Fortran, APL). In some applications (finite element methods), it makes sense for indexes to start at negative numbers.
- SAI_Peregrinus 6y agoIndexes starting at 1 is good. Offsets starting at 0 is good. Confusing offsets for indexes leads to off-by-one errors. C's "array" notation is taught as being an index, when it's actually an offset.