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 671510 - GCalcTool does honor the precedence of operators
GCalcTool does honor the precedence of operators
Status: RESOLVED INVALID
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-07 00:11 UTC by Carlos Silva
Modified: 2012-03-07 00:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Carlos Silva 2012-03-07 00:11:25 UTC
I came across a bug where GCalcTool doesn't honor the precedence of the parentesis.
For example: "6/2(1+2)"
For the above example, the correct result is 1 and not 9.
The correct steps to resolve are:
6/2(1+2) = 6/2(3) = 6/6 = 1
or
6/2(1+2) = 6/(2+4) = 6/6 = 1

The way it is solving is:
6/2(1+2) = 6/2*3 = 3*3 = 9
Comment 1 Carlos Silva 2012-03-07 00:28:24 UTC
My bad... wrong calculations done by me.
The way I was doing the original equation should be "6/(2(1+2))"