On Saturday, 15 December, 2018 10:54, Simon Slavin <slav...@bigfraud.org> wrote: >On 15 Dec 2018, at 5:35pm, Keith Medcalf <kmedc...@dessus.com> wrote:
>> Fast forward 25 years and you would these days be hard pressed to >find a computer that DOES NOT use proper IEEE-754 floating point and >that DOES NOT default to a minimum of double precision representation >and that DOES NOT use extended precision internally to ensure that >the 1 ULP guarantee is ensured. However, the memory of the >proletariat is long: Even though the original issue leading to the >quaint "do not use floating point for money" aphorism no longer >exists the problem of knowing "why this was so" still exists. And >the propensity to apply intermediate rounding still exists. >And yet ... here we are. The post which started this thread summed >currency amounts and reached a total of 211496.25999999992 . >Yes, you can say 'that would have been rounded before it was >printed'. But then you're into the old questions: do you round at >every step, or only at the end ? Do you round or truncate ? Where >does the fraction go ? etc. etc.. You apply half-even rounding (not elementary school 4/5 rounding) only for display (output) and never round intermediates. The "fraction" does not exist ... Though if you do 4/5 rounding rather than half-even rounding the accumulated errors will amount to quite a sum. --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users