TERMIUM Plus®
The Government of Canada’s terminology and linguistic data bank.
FENCEPOST ERROR [1 record]
Record 1 - internal organization data 1998-06-03
Record 1, English
Record 1, Subject field(s)
- Informatics
Record 1, Main entry term, English
- fencepost error
1, record 1, English, fencepost%20error
correct
Record 1, Abbreviations, English
Record 1, Synonyms, English
- off-by-one error 1, record 1, English, off%2Dby%2Done%20error
correct
Record 1, Textual support, English
Record number: 1, Textual support number: 1 DEF
A problem with the discrete equivalent of a boundary condition, often exhibited in programs containing iterative loop. [The term comes from] the following problem: "If you build a fence 100 feet long with posts 10 feet apart, how many posts do you need?" (either 9 or 11 is a better answer than the obvious 10.) 1, record 1, English, - fencepost%20error
Record number: 1, Textual support number: 1 OBS
Fencepost errors come from counting things rather than counting the spaces between them, or vice versa, or by neglecting to consider whether one should count one or both of the ends of a row. 1, record 1, English, - fencepost%20error
Record 1, French
Record 1, Domaine(s)
- Informatique
Record 1, Main entry term, French
- erreur de type fencepost
1, record 1, French, erreur%20de%20type%20fencepost
correct, feminine noun
Record 1, Abbreviations, French
Record 1, Synonyms, French
Record 1, Textual support, French
Record number: 1, Textual support number: 1 DEF
Problème que l'on retrouve souvent dans les programmes intégrant des boucles itératives. Vient du problème suivant : «Si vous construisez une palissade de 100 mètres de long avec des poteaux séparés de 10 mètres, de combien de poteaux avez-vous besoin?». Il vaut mieux répondre neuf ou onze que 10, pourtant plus évident a priori. 1, record 1, French, - erreur%20de%20type%20fencepost
Record number: 1, Textual support number: 1 CONT
Un programme qui utilisera la formule «évidente» contiendra une erreur de type fencepost. 1, record 1, French, - erreur%20de%20type%20fencepost
Record number: 1, Textual support number: 1 OBS
Ici, c'est le décompte des éléments qui emporte et non les intervalles qui existent entre eux. Dit autrement, ce genre d'erreur survient lorsque l'on ne sait pas si l'on doit compter une seule ou les deux extrémités d'une rangée. 1, record 1, French, - erreur%20de%20type%20fencepost
Record 1, Spanish
Record 1, Textual support, Spanish
Copyright notice for the TERMIUM Plus® data bank
© Public Services and Procurement Canada, 2025
TERMIUM Plus®, the Government of Canada's terminology and linguistic data bank
A product of the Translation Bureau
Features
Language Portal of Canada

Access a collection of Canadian resources on all aspects of English and French, including quizzes.
Writing tools

The Language Portal’s writing tools have a new look! Easy to consult, they give you access to a wealth of information that will help you write better in English and French.
Glossaries and vocabularies

Access Translation Bureau glossaries and vocabularies.
- Date Modified: