11th+ decimal places?

I see “6,861.05” in the balance column, but if I copy that cell and paste it in BBEdit, e.g., it is “6861.0500000000575” – what are those tiny fragments of my money doing there?

I tried to understand the Too many decimal places thread from 2017, but my brain overflowed.

The issue here is that computers store and manipulate numbers in a binary format. Many numbers which terminate as decimals will form a never ending repeating pattern in binary. The floating point format used by Macintosh computers can support up to 53 binary digits of precision, which is equivalent to slightly better than 15 decimal digits. Anything requiring more than that will have to be rounded to 53 digits. The only monetary values that terminate in binary are multiples of 0.25. Everything else needs to be rounded off. If you perform a large number of operations, involving a large number of rounded values, these tiny roundoff errors can accumulate and result in a larger error.

You can also get comparatively large errors by subtracting two nearly equal values, so that the difference has a lower order of magnitude than the larger of the two numbers. If you add up all the credits, and then add up all the debits, and then subtract, the balance could have a lower order of magnitude than the sum of the credits, and the roundoff error could be comparatively large.