this post was submitted on 28 Mar 2025
82 points (98.8% liked)

Just Post

799 readers
5 users here now

Just post something ๐Ÿ’›

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 3 points 1 week ago

Yeah, off-by-one errors are the most common error in programming, and when you are off by +1, and then try to bring it down to 0, it rolls over to max value instead. It makes sense, since some things use 0 as 1 and some things use 1 as 1. The programmer usually just has to memorize which is which... so yeah. Not surprising that it is the most common cause of bugs.