Zero-based numbering: Difference between revisions

Content deleted Content added
Infinity and beyond
Tags: Mobile edit Mobile web edit
Undid revision 704497927 by 2A02:C7D:281E:CF00:54EA:4519:AD7C:40CD (talk)
Line 1:
'''Zero-based numbering''' or ''index origin = 0''<ref>{{cite journal|last1=Brown|first1=Jim|title=In Defense of Index Origin 0|journal=ACM SIGAPL APL Quote Quad |date=December 1978 |volume=9 |issue=2 |page=7 |doi=10.1145/586050.586053 |accessdate=19 January 2015}}</ref><ref>{{cite web|last1=Hui|first1=Roger|title=Is Index Origin 0 a Hindrance?|url=http://www.jsoftware.com/papers/indexorigin.htm|website=jsoftware.com|publisher=JSoftware|accessdate=19 January 2015}}</ref> is a way of [[numbering]] in which the initial element of a [[sequence]] is assigned the [[Indexed family|index]] 0, rather than the index 1 as is typical in everyday ''non-programming'' circumstances. Under zero-based numbering, the initial element is sometimes termed the [[0 (number)|''zeroth'']] element, rather than the ''first'' element; ''zeroth'' is a [[word coinage|coined]] [[ordinal number (linguistics)|ordinal number]] corresponding to the number [[zero]]. In some cases, an object or value that does not (originally) belong to a given sequence, but which could be naturally placed before its initial element, may be termed the zeroth element. There is not wide agreement regarding the correctness of using zero as an ordinal (nor regarding the use of the term ''zeroth'') as it creates ambiguity for all subsequent elements of the sequence when lacking context.0
 
Numbering sequences starting at 0 is quite common in mathematics notation, in particular in [[combinatorics]], though programming languages for mathematics usually index from 1. In [[computer science]], [[Array data structure|array]] indices usually start at 0 in modern programming languages, so computer programmers might use ''zeroth'' in situations where others might use ''first'', and so forth. In some mathematical contexts, zero-based numbering can be used without confusion, when ordinal forms have well established meaning with an obvious candidate to come before ''first''; for instance a ''zeroth derivative'' of a function is the function itself, obtained by [[derivative|differentiating]] zero times. Such usage corresponds to naming an element not properly belonging to the sequence but preceding it: the zeroth derivative is not really a derivative at all. However, just as the ''first derivative'' precedes the ''second derivative'', so also does the ''zeroth derivative'' (or the original function itself) precede the ''first derivative''.