Launchpad has imported 3 comments from the remote bug at https://www.libreoffice.org/bugzilla/show_bug.cgi?id=73410.
If you reply to an imported comment from within Launchpad, your comment will be sent to the remote bug automatically. Read more about Launchpad's inter-bugtracker facilities at https://help.launchpad.net/InterBugTracking. ------------------------------------------------------------------------ On 2014-01-08T21:02:45+00:00 Bjbraams-2 wrote: Created attachment 91706 Calc spreadsheet to demonstrate rounding errors for large argument values This report concerns LibreOffice Calc; functions roundup, rounddown, trunc, ceiling, floor, int, even and odd. A minimal set of instructions to reproduce the core of the problem follows. Open a new blank spreadsheet. In the A1 cell enter "=power(2,50)+1" (without the quotes) and in the B1 cell enter "=rounddown(a1,0)-a1" (without the quotes). Expected result: B1=0. Actual result: B1=5. More generally, let y=power(2,50)+1. I expect that rounding y to integer will return y exactly, for any of the functions roundup, rounddown, trunc, ceiling, floor and int. I also expect that even(y)=y+1 and odd(y)=y. Actual results: functions roundup(y,0), rounddown(y,0), trunc(y,0), ceiling(y,1), floor(y,1) and int(y) all return y+5. Moreover, even(y)=y and odd(y)=y+6 according to Calc. (Note that the second argument to roundup, rounddown and trunc indicates number of places behind the decimal symbol and the second argument to ceiling and floor indicates the unit.) There are similar problems with these rounding functions when rounding to some number (>0) of places behind the decimal symbol. The attached spreadsheet illustrates the issue. I have highlighted in yellow the cells where the result is different from what is expected. Row 5 shows the precise results described here; other rows show similar calculations for values y=power(2,x)+1 for other values of x. Reply at: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1261048/comments/7 ------------------------------------------------------------------------ On 2014-01-10T11:32:55+00:00 Markus Mohrhard wrote: Please read about floating point arithmetics. http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems Reply at: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1261048/comments/10 ------------------------------------------------------------------------ On 2014-01-10T11:51:26+00:00 Christopher M. Penalver wrote: Markus Mohrhard, thank you for your comment. While the prior work done in this area is appreciated, in that it replicates the output of Excel (yes, I already know LibreOffice isn't Excel), I think closing this as a Won't Fix is premature, especially predicated on a post from Wikipedia. Despite this, venerable Gnumeric ( https://projects.gnome.org/gnumeric/ ) does in fact provide a more accurate result than LibreOffice or Excel in this instance: lsb_release -rd Description: Ubuntu Trusty Tahr (development branch) Release: 14.04 apt-cache policy gnumeric gnumeric: Installed: 1.12.9-1 Candidate: 1.12.9-1 Version table: *** 1.12.9-1 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages 100 /var/lib/dpkg/status I think this should be discussed much further technically before making such a judgement. Thank you for your understanding. Reply at: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1261048/comments/11 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1261048 Title: [Upstream] Wrong results from rounding functions for large argument To manage notifications about this bug go to: https://bugs.launchpad.net/df-libreoffice/+bug/1261048/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
