Comment 19 for bug 775608

Revision history for this message
In , Björn Michaelsen (bjoern-michaelsen) wrote :

From https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/775608 :

The best way to explain this bug is with a simple example. Type the values 0.1, 0.2, and 0.3 in cells A1, A2, and A3; then on cell C1 type "=PRODUCT(1+A1:A3)-1" without the quotes; and then press <Control><Shift><Enter>. (If you do this correctly, cell C1 will display the formula in curly brackets, i.e., "{=PRODUCT(1+A1:A3)-1}", signifying that C1 contains an array formula.)

If you do this in OpenOffice Calc, cell C1 displays the correct result, 0.716 -- the product of (1+0.1) times (1+0.2) times (1+0.3), less 1. If you do this in LibreOffice Calc, cell C1 displays 0 !!!

Interestingly, this calculation error appears to be a problem only with the PRODUCT function in LibreOffice Calc. For instance, if in the above array formula you substitute PRODUCT with, say, SUM, both OpenOffice and LibreOffice Calc display the correct result, 2.6.

ADDENDUM: I just noticed this calculation error seems to occur only when constants are used as inputs. For example, "=PRODUCT({1, 2, 3})" produces an erroneous result, 1; however, if you enter the values 1, 2, and 3 in cells A1, A2, and A3, "=PRODUCT(A1:A3)" and "=PRODUCT(A1,A2,A3)" both produce the correct result, 6.

I can reproduce this bug a vanilla tag on tag 3.3.2.2 with ./autogen.sh --disable-binfilter --disable-mozilla --with-max-jobs="4" --with-junit=".../junit-4.9b2.jar" --with-system-icu --with-system-db --with-external-tar=... --disable-gtk.

I can _not_reproduce this bug on master as of now, but think we should investigate this issue as it might lead to erroneous calculations that slip by unnoticed for long.