4 ms·
> It’s usually better to start from zero in mathematical formulas too ... No, it's not. There is no universally preferred indexing in mathematics. The indexing
by chestervonwinch 10y ago
> It’s usually better to start from zero in mathematical formulas too ...
No, it's not. There is no universally preferred indexing in mathematics. The indexing scheme that is "natural" changes with the particular application.
There are of course instances when 0-based indexing makes more sense [1], [2]. But, there are cases when starting at 1 is more natural, as well [3]. Moreover, there are instances where starting with negative indices is more natural, say with the coefficients of the truncated Fourier series, or with the weights of a finite difference operator or of a cross-correlation operator.
Fortran supports all these conventions, which allows for a more direct translation of the mathematics to code.
[1]: https://en.wikipedia.org/wiki/Geometric_series#Formula https://en.wikipedia.org/wiki/Geometric_series#Formula
[2]: https://en.wikipedia.org/wiki/Taylor_series#Definition https://en.wikipedia.org/wiki/Taylor_series#Definition
[3]: https://en.wikipedia.org/wiki/Harmonic_series_(mathematics) https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)
- deleted 10y ago[deleted]