After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 527540 - Rounding errors
Rounding errors
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.22.x
Other Linux
: Normal normal
: 2.24.0
Assigned To: Robert Ancell
gcalctool maintainers
Depends on:
Blocks: 571007
 
 
Reported: 2008-04-11 13:23 UTC by Pedro Villavicencio
Modified: 2009-02-28 06:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Pedro Villavicencio 2008-04-11 13:23:57 UTC
This report has been entered here:

https://bugs.edge.launchpad.net/ubuntu/+source/gcalctool/+bug/215663

"If type 4^2-16 calc returns -0. Should be 0."

Thanks,
Comment 1 Rich Burridge 2008-04-11 14:38:36 UTC
Adjusting the summary to reflect that this only happens in
arithmetic precedence mode.
Comment 2 Robert Ancell 2008-04-13 08:52:27 UTC
Sami, Can you have a look at this when fixing 516159, cheers.
Comment 3 Sami Pietilä 2008-04-21 12:30:12 UTC
This seems not to be arithmetic precedence related problem. I am able to reproduce this also in left-to-right precedence mode.
Comment 4 Rich Burridge 2008-04-21 14:56:37 UTC
Interesting. I couldn't. I tried:

4
x2
-
1
6
=

That gives an answer of 0.

Can you give me a set of steps to get an answer of -0?
Comment 5 Sami Pietilä 2008-04-21 19:09:40 UTC
I don't have access to gcalctool right now. However, I remember I tried one of the following with svn head gcalctool:

4
^  (that is, x^y button)
2
-
1
6
=

OR perhaps it was 

4
^  (that is, x^y button)
2
=
-
1
6
=

I can check it again tomorrow. 
Comment 6 Rich Burridge 2008-04-21 19:26:40 UTC
Yup, both of those give -0. 

Adjusting summary to remove '[ARITH]'.
Comment 7 Robert Ancell 2008-11-15 04:56:12 UTC
This seems to be a rounding problem as highlighted in bug 560802. - If you change to scientific mode 4^2-16=-1.740501312e-214
Comment 8 Robert Ancell 2008-11-15 04:56:25 UTC
*** Bug 560802 has been marked as a duplicate of this bug. ***
Comment 9 Robert Ancell 2009-02-28 06:20:32 UTC
Fixed integer power calculations in 5.26.0:
http://svn.gnome.org/viewvc/gcalctool?view=revision&revision=2399