Bug 121464 - Wrong expresion calculating
Summary: Wrong expresion calculating
Status: CLOSED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://bz.apache.org/ooo/show_bug.cg...
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks:
 
Reported: 2018-11-16 13:17 UTC by Xisco Faulí
Modified: 2018-12-18 17:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2018-11-16 13:17:59 UTC
I'm not sure whether it's a bug or not but I'm reporting it just in case.

STR:
1. Open https://bz.apache.org/ooo/attachment.cgi?id=69414 from https://bz.apache.org/ooo/show_bug.cgi?id=111533

-> Observed behaviour: C2 shows 8,29999999999995 instead of 8,3.

Reproduced in

Version: 6.2.0.0.alpha1+
Build ID: 5edc23dbc53773536265fd6a54319d9cd1cd9e99
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

but not in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2018-11-16 13:20:19 UTC
it changed from to 8,3 to 8,29999999999995 in https://cgit.freedesktop.org/libreoffice/core/commit/?id=54862a932fc9ccc1788e91629818ec6666ec1c09

@Eike, @Regina, What's your opinion on this?
Comment 2 Oliver Brinzing 2018-11-17 09:57:02 UTC
i think, it's not a bug, it's a feature:

the result is always: 8,29999999999995

change column width (widen column B or decrease C) and the 
displayed values will change
Comment 4 Xisco Faulí 2018-12-18 15:42:00 UTC
(In reply to Oliver Brinzing from comment #2)
> i think, it's not a bug, it's a feature:
> 
> the result is always: 8,29999999999995
> 
> change column width (widen column B or decrease C) and the 
> displayed values will change

Thanks for checking.
I would like to hear Eike's opinion before closing it...
Comment 5 Eike Rathke 2018-12-18 17:55:20 UTC
Shrug, binary floating point numbers in most cases do not exactly represent accurate decimal numbers. Subtracting these sample numbers does not produce a "pleasing to the eye" exact value with a large enough number of decimals (which the General format produces with a wide enough column). Any cosmetics (e.g. 14 instead of 15 significant digits to round earlier) would just hide things at yet another place.