[Libreoffice-bugs] [Bug 128312] Calculation involing some decimals return incorrect floats with 12 d.p.
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Sat Sep 12 18:19:52 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=128312
--- Comment #14 from b. <newbie-02 at gmx.de> ---
Created attachment 165424
--> https://bugs.documentfoundation.org/attachment.cgi?id=165424&action=edit
test_sum_save_against_fp-rounding
besides that i'd read somewhere that gcc has! a 'decimal' library, and thus
implementing correct decimal math shouldn't be too big an issue ...
(ok, 'performance', but plenty sheets are 'small', and most performance
problems can be thrown on hardware today, the hours and days that users and
supporters waste with irritations about fp-rounding-issues are in my opinion
much worse than a few microseconds of computing time)
... i was curious if it is possible to solve some of the FP problems with
'smart rounding', here is my second try, not a solution, just an attempt of a
proof of concept,
the user defined macro function 'sum_s' rounds the result acc. to the decimal
places of the values, and returns a better result for '=SUM_S(31000.99,
32000.12)' than the standard 'sum' of calc does with '=SUM(31000.99,
32000.12)',
i'm not! sure if this works for all cases / values, it's limited to two
summands, it was tricky enough to get it to work because calc basic has no
function max, it is 'unfinished work', i just want to 'throw it to the people'
for examination and discussion ...
the idea is to show that 'correct' results for calculations with decimal
fractions are possible, with the means available at runtime of the program,
even with the 'subset' of it available to the user, programmers and developers
can do much more,
the idea is not! that now all users should start to calculate with basic macros
(although this might be a quick help for some of them), but to give an
incentive that 'man', we, the programmers / developers try to find a way to
become 'better than ex$el' in this respect, because that would be a 'really
good thing' ... imho
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200912/89350fe3/attachment.htm>
More information about the Libreoffice-bugs
mailing list