[music-dsp] platform choice
richarddobson at blueyonder.co.uk
Mon Nov 2 04:18:47 EST 2009
David Cournapeau wrote:
> On Sun, Nov 1, 2009 at 6:06 AM, Victor Lazzarini
> <Victor.Lazzarini at nuim.ie> wrote:
>> Of course, you can create a C++ template to do this
>> (I am not sure there is one in STL, but there might be).
>> The question is why, since 0-indexing makes much more
> It is really nothing more than a convention.
Hmm, not really. In real life, computers depend on integer types. We all
know that an 8bit number can represent up to 256 distinct values; that
would be 0-255, not 1-256. If we want to count to ten using one digit,
it has to be 0-9, not 1-10.
Why waste a number?
It all comes down to the perennial mixup between formal (cardinal,
ordinal) number theory and "natural language" - there is zero, but we
don't normally speak of "a zeroth item" when counting: humans who insist
on thinking like a human, v the computer that thinks like a computer (at
least, like one with fixed-size integer types).
~Computers~ naturally count from zero - perhaps all we need is to add
one to each value when printing to the screen. Happens all the time.
More information about the music-dsp