Bug 63694 - SUM() ignores small numbers
Summary: SUM() ignores small numbers
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.7.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-18 19:46 UTC by Brian
Modified: 2015-03-15 18:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
demonstrate bug with "sum" vs + (204.10 KB, image/png)
2013-04-18 21:09 UTC, Brian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian 2013-04-18 19:46:32 UTC
Problem description: 

The SUM() function in libreoffice calc treats small numbers (small enough to be displayed in exponential notation) as zero.


Steps to reproduce:

In cell A1, enter: -4.0E-4
In cell A2, enter: 0.01
In cell A3: =SUM(A1:A2)
In cell A4: =A1+A2

In A4, you will see the correct result, but in cell A3, you'll just see a copy of the result in cell A2.  Sum should parse numbers in the same way as other equivalent arithmetic operations.

My understanding is that libreoffice, based on java, is supposed to follow the IEEE 754 standard.  

Scala and python, on the same standard, properly parse the -4E-4 number:

scala> -4.0E-4 + 0.01
res61: Double = 0.009600000000000001

>>> -4.0E-4 + 0.01
0.009600000000000001


If I use the SUM() function in excel it also gives me the correct result.


Current behavior:

The exponential value is ignored, in cell A3 we see the value in cell A2.

Expected behavior:

A3 should contain the value 0.0096, as in A4.


Operating System: Ubuntu
Version: 3.5.7.2 release
Comment 1 GerardF 2013-04-18 20:03:32 UTC
Works for me.
Check if A1 is a number with =ISNUMBER(A1) or with Ctrl+F8 (A1 should be blue).
Comment 2 Brian 2013-04-18 21:09:03 UTC
Created attachment 78196 [details]
demonstrate bug with "sum" vs +
Comment 3 Brian 2013-04-18 21:11:32 UTC
Maybe you're using a different version or OS?

I've attached a screen shot.  Even if the value was not numeric, sum should treat it the same was "+" treats it.  I get different results when using "sum" vs "+".
Comment 4 QA Administrators 2015-03-04 02:21:06 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.1.2 or later): https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior

If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)

Thank you for your help!

-- The LibreOffice QA Team
This NEW Message was generated on: 2015-03-03
Comment 5 Jean-Baptiste Faure 2015-03-15 17:27:11 UTC
Not reproducible with Libreoffice 4.4.3.0.0+ built at home under Ubuntu 14.10 x86-64.

Closing as WorksForMe. Please, feel free to reopen if you encounter the described behavior with one of the current stable versions or with the master.

Best regards. JBF