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:
  Show dependency tree
 
Reported: 2012-03-07 00:11 UTC by Carlos Silva
Modified: 2012-03-07 00:28 UTC (History)
1 user (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments

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))"

Note You need to log in before you can comment on or make changes to this bug.