Bug 100552 - Simple Subtraction error (for example 3,46-3,39)
Summary: Simple Subtraction error (for example 3,46-3,39)
Status: RESOLVED DUPLICATE of bug 94394
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.3.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-22 15:38 UTC by Jiri Liska
Modified: 2016-06-23 22:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Bug of calc in subtraction, 3 examples. The first two are bad, third is ok. (13.62 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-06-22 15:38 UTC, Jiri Liska
Details
Bug subtraction 2 with autofilter (13.18 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-06-23 14:01 UTC, Jiri Liska
Details
Autofilter with mistake column c (99.93 KB, image/jpeg)
2016-06-23 14:02 UTC, Jiri Liska
Details
Autofiltr with column d (95.95 KB, image/jpeg)
2016-06-23 14:02 UTC, Jiri Liska
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Liska 2016-06-22 15:38:50 UTC
Created attachment 125842 [details]
Bug of calc in subtraction, 3 examples. The first two are bad, third is ok.

Hello, I found this simple but crucial mistake.
When I for example deduct 3,46 and 3,39, I get 0,0699999999999998 instead of 0,7. I multiply result by 1000000, I get 69999,9999999998 instead of 70000.

The same mistake is with numbers 4,47 and 4,44. When I use 4,47 and 4,43 the result is ok.

I can find many others examples.

Please find in attachment file, when you can see this mistake.


How this simple mistake can be there?


Jiri Liska
Comment 1 MM 2016-06-22 15:50:01 UTC
That's because of 2 things:

1) Format code in 'format cells' is set as '0.0000000000000000' instead of general.
2) Options > LO Calc > Calculate > Limit decimals..... is unchecked. Set to '2' and the formula works again.

So not a bug.
Comment 2 Julien Nabet 2016-06-22 20:09:14 UTC
Following MM's comment, let's put this one as NOTABUG.

Don't hesitate to reopen this tracker if there's still a pb.
Comment 3 Jiri Liska 2016-06-23 14:01:42 UTC
Created attachment 125859 [details]
Bug subtraction 2 with autofilter
Comment 4 Jiri Liska 2016-06-23 14:02:17 UTC
Created attachment 125860 [details]
Autofilter with mistake column c
Comment 5 Jiri Liska 2016-06-23 14:02:39 UTC
Created attachment 125861 [details]
Autofiltr with column d
Comment 6 Jiri Liska 2016-06-23 14:02:49 UTC
I still insist on bug. I have 2 proofs:
1. Subtraction 4,47 and 4,43 (row 4 in file) is right 0,04 and I can put as much as possible decimal place (I use on it icon with green plus with .0 .00 in menu). When I make the same with row 2 (3,46-3,39) or 3 (4,47-4,44) I get on 16th decimal place mistake. Why for 4 row it is ok and for 2 or 3 is mistake?

2. I did everything what you wrote (general format + change settings). You can see it in new attached file. I add autofilter. Why I have in column c in autofilter 0,0299999999999994 instead of 0,3 and 0,04 and 0,069999999999998 instead of 0,7?
In column d in filter I see 29999,999999994 etc.
Is it normal??????
I also make print screen for 2nd point and put it as attached.
Comment 7 Julien Nabet 2016-06-23 19:43:52 UTC
I wonder if it could be OpenCL pb, could you try this:
- menu Tools/options
- OpenCL
- uncheck both checkboxes
- restart LO and give a new try
?
Comment 8 Jiri Liska 2016-06-23 21:47:17 UTC
I unchecked both options in OpenCL, like wrote Julien Nabet. The result is the same. Mistake still occure, nothing change.
Comment 9 m_a_riosv 2016-06-23 21:53:47 UTC
I think a good explanation by Eike about this kind of issues.
https://bugs.documentfoundation.org/show_bug.cgi?id=94394#c1

*** This bug has been marked as a duplicate of bug 94354 ***
Comment 10 Jiri Liska 2016-06-23 22:01:08 UTC
I am sorry, it is my first bug report. I don't understand you, how m.a.riosv can marked my bug duplicate of bug 94354. What I red, bug 94354 is something about freezing of writer.
This bug is about subtraction in calc.
???????????
Comment 11 m_a_riosv 2016-06-23 22:48:54 UTC
Sorry, my mistake writing the number it's duplicate of bug linked in comment#9.

https://bugs.documentfoundation.org/show_bug.cgi?id=94394#c1 already closed.

*** This bug has been marked as a duplicate of bug 94394 ***