SQLite Forum

Decimal128
Login
> These epsilons do not all have the same sign,

But they MIGHT all have the same sign (or most of them). That is the difference between looking at an 'expected' error and a worse case error. IF you know the numbers coming in are uncorrelated, you can assume a lot of cancelations. So if you are starting with numbers that truly are approximations, and independent of each other the error is a lot smaller.

Money though, at its root is an exact number, and financial numbers often aren't that independent, and you are often worried about 100% accuracy, not just good to 'x' sigmas, so the analysis rules are different.

It is common to assume independence because it makes things a lot simpler, It is rarely 100% true, but often true enough to get away with it. If you really need the right answer, it gets a lot harder.