In computer programming, a fencepost error (occasionally called a "lamp-post error") is a computer bug involving the discrete equivalent of a boundary condition, often exhibited in programs by iterative loops. This can also occur in a mathematical context, but is not usually named.
Many people will intuitively divide 100 by 10 and thus answer 10, but this is incorrect. The fence certainly has 10 sections, but there are 11 posts.
A rare secondary meaning is an error induced by unexpected regularities in input values, which can (for instance) completely thwart a theoretically efficient binary tree or hash function implementation. The error here involves the difference between expected and worst case behaviours of an algorithm.
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Fencepost error".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world