3 ms·
I found this article interesting, but the HN title ("Off-by-one error...") doesn't match the article's, or its conclusion? The article mentions a boundary cond
by ipsin 5y ago
I found this article interesting, but the HN title ("Off-by-one error...") doesn't match the article's, or its conclusion?
The article mentions a boundary condition ("_share_price > 0"), not an off-by-one error.
- karatinversion 5y agoThe off by one error is that the condition should have been >= 0
- deleted 5y ago[deleted]
- Dylan16807 5y ago"An off-by-one error or off-by-one bug (known by acronyms OBOE, OBO, OB1 and OBOB) is a logic error involving the discrete equivalent of a boundary condition." And these are discrete numbers, so I don't see the problem. A huge fraction of off by one errors are > vs >= or < vs <= in a for loop.