[Linux-bruxelles] Logiciels libres ULB
Frederic Peters
fpeters at entrouvert.com
Ven 27 Oct 13:35:49 CEST 2006
Gaëtan Frenoy écrivait :
> Le Fri, 27 Oct 2006 11:34:51 +0200 (CEST), Miguel Quaremme a écrit:
> > oui, en informatique on commence à compter à 0.
>
> Mmm...
>
> Ne serait-ce pas plutôt : dans un langage extrêmement populaire
> (le C) le premier élément d'un tableau est l'élément 0.
> (et ce pour des raisons techniques)
>
> Ceux qui ont un peu trop pratiqué ce langage ont donc pris
> la mauvaise habitude de commencer à compter à partir de 0.
>
> Cela ne me semble cependant pas une règle absolue.
Assez rapidement,
http://en.wikipedia.org/wiki/0_(number)
Computer Science
- Numbering from 1 or 0?
People usually number things starting from one, not zero. Yet in
computer science zero has become the popular indication for a starting
point. For example, in almost all old programming languages, an array
starts from 1 by default. As programming languages have developed, it
has become more common that an array starts from zero by default. And
the first item in the array is item 0. (Note: the word "first" is
unrelated to the number 1.) In particular, the popularity of the
programming language "C" in the 80s has made this approach common.
Évidemment pas de règle absolue mais quand même *has become the
popular indication for a starting point*.
En continuant à chercher,
http://en.wikipedia.org/wiki/Array#Array_system_cross-reference_list
Cette page contient un tableau reprenant 16 langages, et le numéro
qu'ils attribuent au premier élément.
Frédéric
Plus d'informations sur la liste de diffusion Linux-bruxelles