Live data from Hacker News

Numbering should start at zero (1982)

cs.utexas.edu

201–210 of 309 posts

Re: Numbering should start at zero (1982)

#201
post #187

Earlier quoted context omitted.

> Zero is a natural number. It is in the axioms of Peano arithmetic, and any other definition is just teachers choosing a taxonomy that best fits their lesson. It is, but it need not be. In the category of pointed sets with endofunctor, (Z_{\ge 1}, 1, ++) and (Z_{\ge 0}, 0, ++) are isomorphic (to each other, to (Z_{\ge 937}, 937, ++), and to any number of other absurd models), so either would do equally well as a mod…

I may be misunderstanding your argument, but if it's that of a simple offset, then only the one starting from 0 forms a monoid (a group without an inverse to each element). Though, of course, you could redefine the + operation...

> I may be misunderstanding your argument, but if it's that of a simple offset, then only the one starting from 0 forms a monoid (a group without an inverse to each element). Though, of course, you could redefine the + operation...

Yes, agreed, there is other algebraic structure that can tell the difference, but Peano arithmetic by itself cannot.

Re: Numbering should start at zero (1982)

#202

Numbering should start at π (2025) (umars.edu) Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them (0-based). The former uses natural numbers, while the latter uses non-negative integers For instance, when dealing with memory words, do u address the word itself or its starting location (the first byte)? The same consideration applies to coordinate systems: r u pos…

Why do you write “you” as “u” here? I don’t want to be rude, but it’s very jarring to see juvenile txt-speak in a serious discussion.

I want to be rude.

The mix of "The same consideration applies to coordinate systems:" and "r u positioning urself..." in the same message is ridiculous to me and I can't take anyone seriously who speaks like this.

It's not illegal or immoral, but it is at the very least, demonstrably distracting from their own actual substantive point. Here we all are talking about that when they otherwise had a perfectly good observation to talk about.

Everyone is jumping on your use of the word "serious" as though you meant serious like cancer instead of just not texting ya bro bout where u at tonite, as though there are only two levels of formal and informal, the two extremes.

If this is so casual and we are txting, then why did they use punctuation and no emojis? Ending sentences with periods is verbal abuse now, so, I guess we're not txting after all? Pick a lane!

Re: Numbering should start at zero (1982)

#203

Numbering should start at π (2025) (umars.edu) Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them (0-based). The former uses natural numbers, while the latter uses non-negative integers For instance, when dealing with memory words, do u address the word itself or its starting location (the first byte)? The same consideration applies to coordinate systems: r u pos…

> Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them

I've never heard the distinction stated this way. It's clarifying.

Re: Numbering should start at zero (1982)

#204
post #179

Earlier quoted context omitted.

at the whitney art gallery (nyc), the ground floor is 1, but the basement is -1. there's no 0 in between it bothers me way more than it should. i have to tell myself that the point of art is often to evoke emotions, and the rage i feel is included in that

In the '80s the ground floor of the EE building (Steele) at Caltech was labeled ⏚. Anyone here happen to know if it is still labeled that way?

I'd certainly hope any floor was ⏚'ed.

Re: Numbering should start at zero (1982)

#205

Earlier quoted context omitted.

Same in Germany, just that we usually call it ground floor instead of 0th floor. You could argue it's a bit of a translation error. The French and German words for floor are referring to ways to add platforms above ground. Either by referring to walls, wooden columns or floor joists. Over the course of language evolution those words have both broadened and specialized, referring to building levels in general. But the…

It’s the same in non-American Anglo countries as well. Zero-indexed with the zeroth floor being called “ground”.

In my (physics faculty) building 0 is the lowest floor. 2 is ground level.

I used to work in Civil Eng which started at either G or 0.

Re: Numbering should start at zero (1982)

#206

I've always appreciated Ada's approach to arrays. You can create array types and specify both the type of the values and of the index. If zero based makes sense for your use, use that, if something else makes sense use that. e.g. type Index is range 1 .. 5; type My_Int_Array is array (Index) of My_Int; It made life pretty nice when working in SPARK if you defined suitable range types for indexes. The proof steps were…

Many BASIC dialects had this too, which could make some code a bit easier to read e.g.

    DIM X(5 TO 10) AS INTEGER
I recall in one program I made the array indices (-1 TO 0) so I could alternate indexing them with the NOT operator (in QuickBASIC there were only bitwise logical operators).

Re: Numbering should start at zero (1982)

#209
post #11

I found it devastating that there are no distinct agreed-upon words denoting zero- and one-based addressing. Initially I thought that the word "index" clearly denotes zero-base, and for one-base there is "order", "position", "rank" or some other word, but after rather painful and humiliating research I stood corrected. ("Index" is really used in both meanings, and without prior knowledge of the context, there is real…

I mean, I think "ordinal" and "zordinal" would work.
Post reply on HN