5 ms·
I think the poster meant off-by-one doesn’t simply mean a plus or minus one error, like mispricing a $5.99 as $6.99, but instead must be born out of confusion a
by hyperhello 2y ago
I think the poster meant off-by-one doesn’t simply mean a plus or minus one error, like mispricing a $5.99 as $6.99, but instead must be born out of confusion as to whether an origin point is marked as a 1 or as a 0.
- Kiro 2y ago> must be born There are other reasons as well. I think the more common causes are inclusive vs exclusive comparison errors and fencepost.
- fmbb 2y agoOff-by-one is not born from the base of the index. It is a general problem a lot of people run into in a lot of different contexts. It’s for example called “the fencepost problem”: https://betterexplained.com/articles/learning-how-to-count-avoiding-the-fencepost-problem/ https://betterexplained.com/articles/learning-how-to-count-a... I agree subtracting or adding one to any number is not the problem. It has to do with counting.
- fsckboy 2y ago>I agree subtracting or adding one to any number is not the problem. It has to do with counting. if you are sprint climbing and you put your hand out to grab and you add or subtract the number 1 from where your hand needs to be, it is a problem or contributes to a speed difference.
- richrichardsson 2y agoPerhaps the pieces are placed by counting a number of holes from piece A to piece B? That's a perfect recipe for an off-by-one: at which point relative to piece A do you start counting.