elf@utcsrgv.UUCP (Eugene Fiume) (08/03/83)
Ahhh, gimme a break you positive number bigots. Numbering from zero makes perfect, and dare I say it, natural sense. The first natural number happens to be zero, which will sound confusing only to those who mix up ordinal and cardinal numbers. I personally believe there has been a combination redneck/pinko conspiracy against this most beautiful of cardinal numbers. "Off by ones" are not a function of the number system (any more than say, the recent stupid and nearly disastrous metric/imperial mixup in filling up a jet liner is the fault of the metric system). On the other hand, if everyone were converted to using the natural numbers instead of the positives, then "off by ones" would be replaced by "off by zeros", which as everyone knows, wouldn't be a problem. nyuck nyuck Eugene Fiume utcsrgv!elf U of Toronto
ucbesvax.turner@ucbcad.UUCP (08/05/83)
#R:utcsrgv:-188200:ucbesvax:3800003:000:794 ucbesvax!turner Aug 4 20:10:00 1983 I finally figured out what is, for me, the right way to think about zero-based array indexing. In set theory, natural numbers are represented as sets containing all lesser numbers. Thus, 0 is the empty set, 1 is {0}, 2 is {0, 1}, and so on. The eta symbol for "element of" thus neatly concides with the "<" relation. In C, "int array[size]" is then a mapping from the set "size", containing all natural numbers less than "size", to a subset of all possible ints. To my mind, much more elegant than the fortrash conventions. This discussion should really start heading toward net.flame. To help it get there, let me rephrase the first sentence of this note: "I finally figured out the ONLY REASONABLE WAY to think about...." See you there. Michael Turner ucbvax!ucbesvax.turner