<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED NOTABUG - Calculation involing some decimals return incorrect floats with 12 d.p."
href="https://bugs.documentfoundation.org/show_bug.cgi?id=128312#c14">Comment # 14</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED NOTABUG - Calculation involing some decimals return incorrect floats with 12 d.p."
href="https://bugs.documentfoundation.org/show_bug.cgi?id=128312">bug 128312</a>
from <span class="vcard"><a class="email" href="mailto:newbie-02@gmx.de" title="b. <newbie-02@gmx.de>"> <span class="fn">b.</span></a>
</span></b>
<pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=165424" name="attach_165424" title="test_sum_save_against_fp-rounding">attachment 165424</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=165424&action=edit" title="test_sum_save_against_fp-rounding">[details]</a></span>
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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>