What does off-by-one error mean?
In software engineering, off-by-one error means a common bug where a loop or calculation goes one step too far or stops one step too early, often because counting starts at zero.
Software Engineering vocabulary · Debugging and Troubleshooting
In Turkish: bir eksik/bir fazla hatası, sınır hatası
Type at least 2 characters to search all fields.
How it is used
Typical causes are using <= instead of <, or forgetting that the last index is the length minus one. A well-known joke says there are two hard problems in computer science: naming things, cache invalidation and off-by-one errors.
Example sentences
The report missed the last day of the month because of an off-by-one error in the date range.
Check the loop condition; it looks like a classic off-by-one error.
Common collocations
- classic off-by-one error
- off-by-one bug
- fix an off-by-one error
- fencepost error
Related terms
More terms: Debugging and Troubleshooting
Practise with graded reading
Reading at the right level is the fastest way to make new words stick. Pick free English books by level:
