Please enable JavaScript to use CodeHS

CodeHS Glossary


Off-by-One Error General

A logic error where a loop or calculation is off by exactly one, such as a loop that repeats one time too many or one time too few. Off-by-one errors often come from using the wrong boundary in range() or the wrong comparison operator.