You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2014/12/29 01:57:35 UTC

[Issue 125978] New: Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

https://issues.apache.org/ooo/show_bug.cgi?id=125978

          Issue ID: 125978
        Issue Type: DEFECT
           Summary: Result of (114,48-112,49) is not 1,99 but
                    1,99000000000001000000
           Product: Calc
           Version: 4.1.1
          Hardware: PC
                OS: Windows 7
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: ui
          Assignee: issues@openoffice.apache.org
          Reporter: b.overgaauw@isisia.fr

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |rb.henschel@t-online.de
         Resolution|---                         |DUPLICATE

--- Comment #8 from Regina Henschel <rb...@t-online.de> ---
That is a known limitation of the internal representation of numbers in data
type double.

Find similar problems in https://wiki.openoffice.org/wiki/User:Regina/MyDrafts

Tips:
You can round the result to a lower precision.
Do not make case distinction with =0 but with abs(..)<1E-10 e.g.
When calculating with currency, calculate with integer values of the smallest
unit, e.g do not use Euro but Cent; only display results in Euro.

If you need an accuracy of more than 14 digits, a spreadsheet is the wrong
tool.

*** This issue has been marked as a duplicate of issue 69749 ***

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

oooforum <oo...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
                 CC|                            |oooforum@free.fr
         Resolution|---                         |NOT_AN_ISSUE

--- Comment #6 from oooforum <oo...@free.fr> ---
According to comment #5, great number of popular software deal only with
floating point arithmetcs. So is in the case of Calc or Excel. The double
precision data type has only 15 to 16 decimal numbers; all the rest is scaling,
being a kind of “digital zooming”, informally speaking. But this is enough for
many practical purposes.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

--- Comment #2 from Boudewijn OVERGAAUW <b....@isisia.fr> ---
The same problem occurs with the formula "=334,71-330,5" (or using the two
numbers in two cells), which results in the value  4,20999999999998 instead of
4.21.

Tested with OpenOffice 4.1.1 under Windows 7 and XP (as well as with Excel 2007
under Windows 7...).

I'm getting worried there is a whole sequence of combinations that gives
incorrect results...

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

brinzing <ol...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |oliver.brinzing@gmx.de

--- Comment #4 from brinzing <ol...@gmx.de> ---
Created attachment 84327
  --> https://issues.apache.org/ooo/attachment.cgi?id=84327&action=edit
subtraction demo

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

brinzing <ol...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |CONFIRMED
     Ever confirmed|0                           |1

--- Comment #5 from brinzing <ol...@gmx.de> ---
Excel 2010 / OO 3.2 Win7/64bit calc's same way
maybe related to
http://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel#Subtraction_of_Subtraction_Results

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

--- Comment #1 from Boudewijn OVERGAAUW <b....@isisia.fr> ---
The sum of the numbers 114,48 and -112,49 is systematically
1,99000000000001000000 instead of 1,99. To see this error, one may have to
change the cell format to show the appropriate amount of decimals.

The issue occurs when entering "=114,48-112,49" in a cell, as well as when
adding the contents of two cells containing the values 114,48 and -112,49

Checked with:

OpenOffice 4.0.1 under Windows 7
OpenOffice 4.1.1 under Windows 7
OpenOffice 4.1.1 under Windows XP

and, for what it is worth:

OpenOffice.org 2.4.1 under openSUSE Linux 10.1

BTW, Excel 2007 under Windows 7 seems to make the same error...

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

--- Comment #3 from brinzing <ol...@gmx.de> ---
*** Issue 125977 has been marked as a duplicate of this issue. ***

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125978] Result of (114,48-112,49) is not 1,99 but 1,99000000000001000000

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125978

Boudewijn OVERGAAUW <b....@isisia.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |b.overgaauw@isisia.fr
         Resolution|NOT_AN_ISSUE                |---

--- Comment #7 from Boudewijn OVERGAAUW <b....@isisia.fr> ---
I encountered this issue while using simple additions and subtractions in
formulas in a simple bookkeeping spreadsheet to verify that amounts add up.
Because of this error, these formulas simply don't work.

I would not have been surprised to see such errors in multiplication and
division calculations, but not with additions and subtractions. It may not be a
problem for many practical purposes, but I expect the use of comparison
formulas to be far from exotic, so "many" is definitely not "almost all".

As for the fact that many popular software programs deal only with floating
point arithmetic and therefore have this error, that should not be a reason for
Calc to behave the same - erroneous - way IMHO.

I could live with a work-around, if one exists.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.