3 ms·
Since the price is not an integer, this is not an “off-by-one” error. No? It was the common mistake of writing `>` when `>=` was intended.
by leephillips 5y ago
Since the price is not an integer, this is not an “off-by-one” error. No? It was the common mistake of writing `>` when `>=` was intended.
- rmetzler 5y agoWhat do you think would be a better name? I kind of agree with you, but then, since it would fit for integers, I can’t think of a better name and could live with some generalization of “off by one”. I’m not a mathematician but maybe something like “off by n; n -> lim 0”
- Negitivefrags 5y agoAmoung my friends when we used to do ACM programming competitions we called it “Off by equals error” since it was actually a fairly common issue in those types of programs and it was useful to have a name for it. “I think you are off by equals here”
- leephillips 5y agoI’m not sure. Since it is related to the distinction in mathematics between open and closed intervals (except on computers we have floats in instead of reals), maybe “interval error” or “endpoint error”. But not “bounds error”, of course. EDIT: Or maybe “comparison error”. I like that the best. But calling it an off-by-one seems wrong, especially as what we usually mean by that is something more like not handling the last iteration of a loop correctly.
- iterati 5y agoIt's a boundary condition error.
- aidenn0 5y agoAre prices really not integers? That alone seems a huge design flaw. BTC prices are integers (in units of Satoshis, which are smaller than BTC).
- leephillips 5y agoOh, I don’t know. I was assuming they were some kind of fixed point number.