![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re^6: why the array index has to start at 0??by LanX (Saint) |
on Oct 13, 2013 at 11:55 UTC ( #1058065=note: print w/replies, xml ) | Need Help?? |
> To me it seems math people usually exclude zero nope. Math people changed their mind, but for historical reasons there is some confusion.¹ Natural numbers are defined by successively adding 1 and zero is the neutral element of addition. It's much easier to operate on sets with neutral element included! Most integer operations (at least in Perl) can return 0. Thats the meta-argument why Moritz's answer makes perfect sense. This way combinations of integer functions always include another neutral element as possible result. For instance otherwise adding the sum of the first index of two arrays would be 2 (the second element) instead of 0 (again the first) Cheers Rolf ( addicted to the Perl Programming Language) 1) the concept of natural numbers was older than group theory
In Section
Seekers of Perl Wisdom
|
|