Off-by-one Error

Off-by-one Error

An off-by-one error (OBOE) is a logic error involving the discrete equivalent of a boundary condition. It often occurs in computer programming when an iterative loop iterates one time too many or too few. This problem could arise when a programmer makes mistakes such as using "is less than or equal to" where "is less than" should have been used in a comparison or fails to take into account that a sequence starts at zero rather than one (as with array indices in many languages). This can also occur in a mathematical context.

Read more about Off-by-one Error:  Looping Over Arrays, Fencepost Error, Security Implications

Famous quotes containing the word error:

    I have often been reproached with the aridity of my genius; a deficiency of imagination has been imputed to me as a crime; and the Pyrrhonism of my opinions has at all times rendered me notorious. Indeed, a strong relish for physical philosophy has, I fear, tinctured my mind with a very common error of this age—I mean the habit of referring occurrences, even the least susceptible of such reference, to the principles of that science.
    Edgar Allan Poe (1809–1849)