Encyclopedia > Zeroth

  Article Content

Zeroth

The zeroth item is the initial item of a sequence, if that sequence is numbered beginning from zero rather than one. This kind of numbering is common in computer systems, and so hackers and computer scientists often use zeroth where others might use first, and so forth.

In computer science, zero is the smallest natural number, and the base case for many kinds of numerical recursion. Thus, proofs and other sorts of mathematical reasoning in computer science often begin with zero. Zero is also the lowest unsigned integer value, one of the most fundamental types in programming and hardware design. For these reasons, CS scholars are accustomed to count from zero rather than one.

This preference is embedded in many influential programming languages, including C and Lisp. In both, sequence types (C arrays and Lisp lists and vectors) are indexed beginning with the zero subscript. Particularly in C, where arrays are closely tied to pointer arithmetic, this makes for a simpler implementation. Other languages have adopted one-based arrays for a closer correspondence to the usual ordinal numbers.

Hackers and computer scientists often like to call the first chapter of a publication "Chapter 0", especially if it is of an introductory nature. One of the classic instances was in the First Edition of K&R. In recent years this trait has also been observed among many pure mathematicians, who have an independent tradition of numbering from 0.

Zero-based numbering tends to reduce fencepost errors, though it cannot eliminate them entirely.

A common use of zeroth outside computing is in the name of the Zeroth Law of Thermodynamics, a law that was formulated after the first, second and third laws.

In the realm of fiction, Isaac Asimov eventually added a 'Zeroth Law' to his famous Three Laws of Robotics.


Article based on zeroth (http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=zeroth) at FOLDOC (http://www.foldoc.org), used with permission.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
User:Kingturtle

... and chess 3 Regarding birds 4 Regarding health and science 5 Regarding history, business and current events 6 Regarding entertainment 7 Regarding th ...