Bug 188617 - Substraction gives erroneous result
Summary: Substraction gives erroneous result
Status: RESOLVED DUPLICATE of bug 167986
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-01 21:14 UTC by Hervé Fache
Modified: 2009-04-04 16:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hervé Fache 2009-04-01 21:14:35 UTC
Version:            (using KDE 4.2.1)
OS:                Linux
Installed from:    Ubuntu Packages

I type Alt-F2 to start krunner. Then I type my calculation: '=66.02 -25.37'
It gives me the following result: '40.64999999999999'

Same if I type '66.02 - 25.37 ='
Comment 1 Hervé Fache 2009-04-03 09:43:57 UTC
This is also the case in:
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Ubuntu Packages
Comment 2 Fábio Firmo 2009-04-03 23:03:19 UTC
This is a expected rounding error, due the hardware representation of real numbers. The result is the same in the python interpreter, for example.

This report can be closed, I think. A more sophisticated calculator engine can be requested by a wish.
Comment 3 Dominik Tritscher 2009-04-03 23:10:38 UTC

*** This bug has been marked as a duplicate of bug 167986 ***
Comment 4 Hervé Fache 2009-04-04 16:21:01 UTC
Fábio, rounding errors are for divisions. This is a substraction and no rounding is necessary.

This is a bug, and a big one, as can be seen in the examples in https://bugs.kde.org/show_bug.cgi?id=167986 (the original bug of which mine is a duplicate).