Off-by-one error
Logical error that can often be found in programming / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Off-by-one error?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
An off-by-one error or off-by-one bug (known by acronyms OBOE, OBO, OB1 and OBOB) is a logic error that involves a number that differs from its intended value by +1 or −1. It often occurs in computer programming when a loop iterates one time too many or too few, usually caused by the use of non-strict inequality (≤) as the terminating condition where strict inequality (<) should have been used, or vice versa. Off-by-one errors also stem from confusion over zero-based numbering. An off-by-one error can sometimes appear in a mathematical context.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
|
"OBOB" redirects here. For the book trivia competition, see Oregon Battle of the Books.