I have long assumed that beeminder is internally using 64-bit floating point numbers for fractional data, and that this is not something that would cause me any problems (though I hadn’t thought about it very hard).
However, I was doing some road calculations recently and realized that there’s probably a subtle correction that happens somewhere, and now I’m curious what it is so that my road calculations can match whatever beeminder is doing.
So in particular I have a goal that is calibrated so I do 5 items per week, i.e 5/7 items per day.
The roadall value is as follows:
[[1747670400,
0,
0],
[1747670400,
0,
0],
[1747670400,
1,
0],
[1748793600,
10.285714285714286,
0.7142857142857143],
[1748793600,
11,
0],
[1753545600,
50.28571428571429,
0.7142857142857143],
[1754150400,
50.28571428571429,
0],
[4102419600,
19463.857142857145,
0.7142857142857143]]
The interesting bit is the last two entries, where we have a flat section with a value of 50.28571428571429, and then we continue with the normal slope of 0.7142857142857143. If we add these values together (to get the cumulative amount due on the first day after the break) with standard floating-point arithmetic, we get 51.00000000000001.
I realize now that I’m actually not 100% sure that beeminder won’t require an extra item on that day, but I wasn’t expecting that to happen. Assuming that’s not what happens, what logic is beeminder using internally to avoid that outcome?