<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:winfrieddonkers@libreoffice.org" title="Winfried Donkers <winfrieddonkers@libreoffice.org>"> <span class="fn">Winfried Donkers</span></a>
</span> changed
<a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - GEOMEAN gives Err:502 when an argument is zero"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=109096">bug 109096</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>UNCONFIRMED
</td>
<td>ASSIGNED
</td>
</tr>
<tr>
<td style="text-align:right;">Assignee</td>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
<td>winfrieddonkers@libreoffice.org
</td>
</tr>
<tr>
<td style="text-align:right;">Ever confirmed</td>
<td>
</td>
<td>1
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - GEOMEAN gives Err:502 when an argument is zero"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=109096#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - GEOMEAN gives Err:502 when an argument is zero"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=109096">bug 109096</a>
from <span class="vcard"><a class="email" href="mailto:winfrieddonkers@libreoffice.org" title="Winfried Donkers <winfrieddonkers@libreoffice.org>"> <span class="fn">Winfried Donkers</span></a>
</span></b>
<pre>(In reply to Julien Nabet from <a href="show_bug.cgi?id=109096#c1">comment #1</a>)
<span class="quote">> I suppose since Excel doesn't accept <= 0 values (see
> <a href="https://support.office.com/en-us/article/GEOMEAN-function-db1ac48d-25a5-40a0">https://support.office.com/en-us/article/GEOMEAN-function-db1ac48d-25a5-40a0</a>-
> ab83-0b38980e40d5), it won't be too on LO for compatibility.
>
> Winfried: thought you might be interested in this one.</span >
Well, this requires some mathematical explanation.
The geometric mean is defined as
ROOTn( a1*a2*...*an )
This definition clearly allows 0 as value for any a.
Unfortunately, on computers the product may well rise above the maximum value
that can be stored, particularly with large values and a large number of
values.
There as also another definition for geometric mean, which does not have this
overflow problem:
EXP( ( ln(a1)+ln(a2)+...+ln(an) ) / n ) (with all values > 0)
or
-1^(m/n) * EXP( ( ln(|a1|)+ln(|a2|)+...+ln(|an|) ) / n ) (with m values < 0)
This definition is generally used in computer applications, but has the
disadvantage that it cannot accept any value of 0.
However, when looking at the first definition, it is clear that with any value
being 0 the geometric mean will be 0, regardless of n and other values.
This means that when computing the second algorithm, a result of 0 can be
returned at the moment a value of 0 is read.
reference: <a href="https://en.wikipedia.org/wiki/Geometric_mean">https://en.wikipedia.org/wiki/Geometric_mean</a>
GEOMEAN is defined in ODFF1.2 without constraints, so changing the behaviour as
described directly above will comply with ODFF. The interoperability with Excel
is reduced in so far that Calc accepts more than Excel, with Calc being
mathematically correct.
It'll be easy to fix.
At the same time I will fix another issue (not yet reported): negative values
are not accepted yet.</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>