16 dec 2015, Keith Medcalf: >> BEGIN; >> UPDATE fmtemp SET bal = ROUND(bal,2) + 123.45; >> (repeat a 1.000.001 times >> END; >> SELECT bal FROM fmtemp; >> 123450123.45 > > You should NEVER round as you have done above. You may get lucky > and the errors may cancel each other out, or you may get more usual > results where the error equals the theoretical max of the sum of the > absolute value of all the truncated values, which can be quite > significant depending on the scale of the number you are dealing > with (and theior scales relative to each other).
Hello, I was only trying to digest JKL's post and the result looks good. The example prints the value as it is in the database and shows that there is no accumulated error there. I do not see a counter example (not yet). Ok this does not work of any scale of numbers. But a solution with integers neither does E.Pasma