An introduction to the Julia language, part 1
An introduction to the Julia language, part 1
Posted Aug 31, 2018 16:08 UTC (Fri) by rsidd (subscriber, #2582)In reply to: An introduction to the Julia language, part 1 by farnz
Parent article: An introduction to the Julia language, part 1
Zero-indexing makes sense for "discretized" continuous or periodic things. It makes sense to label the first hour after midnight the zero hour: the markers are 0 and 1, at either end, and even for continuous periodic things, the "mod" argument makes some sense for zero-indexing.
For sequences in general, nobody refers to "a" as the zeroth letter in the word "algorithm". It is the first letter. This is just how daily language works and also how mathematical notation works for the most part. The FFT may start from a zero-index but that's fundamentally because it's based on an assumption that the sequence is periodic. Vectors are always 1-indexed, except in relativity where time gets the index 0 while spatial indices are 1,2,3 -- and that too is for historic reasons (originally time was 4, but in imaginary units; when they figured it's better to use real units and a non-Euclidean metric, they chose 0 to avoid confusion.)
