|
|
|
|
|
by dr_zoidberg
1250 days ago
|
|
> The 0 indexing in python does really and truly suck sometimes though. Now that's something you usually don't hear. At my university I heard a bit of "urban legend" about how back in the day (think early 1990's) a couple of professors got a peer-reviewed article published because they found out that Matlabs 1-indexed implementation of some algorithm resulted in numerical errors, which they measured and corrected. Don't really remember the details, and most of those involved have already retired. |
|
The problem isn't whether 0 or 1 are "right" or not, it's the inconsistency. It makes transcribing something from a textbook harder, because the indexing logic in a textbook algorithm can get quite intricate. It's even worse if they use slices like M[i:j,m:n].
Indexing from 1 is the standard in many areas, going back many decades. SWEs have adopted a different convention.