Article View: comp.lang.misc
Article #5228Re: The Joy of Zero-based Arrays
From: Wayne A. Christopher
Date: Mon, 07 Mar 1988 18:44
Date: Mon, 07 Mar 1988 18:44
8 lines
724 bytes
724 bytes
If you're looking for mathematical justifications for 0-based or 1-based
arithmetic, remember that the usual definition of n in set theory is
{ n-1, n-2, ... 1, 0 }. Thus by analogy an array of n elements contains
elements n-1, n-2, ... 1, 0.
Really it's a matter of taste, like hex vs octal.
Wayne
Technical Details
Message-ID:
<1304@pasteur.Berkeley.Edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ic.Berkeley.EDU!faustusReferences:
<25349@cca.CCA.COM> <1012@PT.CS.CMU.EDU> <17419@think.UUCP> <213@sdti.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ic.Berkeley.EDU!faustus From: faustus@ic.Berkeley.EDU (Wayne A. Christopher) Newsgroups: comp.lang.misc Subject: Re: The Joy of Zero-based Arrays Message-ID: <1304@pasteur.Berkeley.Edu> Date: 7 Mar 88 18:44:16 GMT References: <25349@cca.CCA.COM> <1012@PT.CS.CMU.EDU> <17419@think.UUCP> <213@sdti.UUCP> Sender: news@pasteur.Berkeley.Edu Lines: 7