Problems with order of operations

Bug #761829 reported by Michał Dulko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GCalctool
Confirmed
Undecided
Unassigned
gcalctool (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: gcalctool

48÷2(9+3) = 288 and this is the right answer, but gcalctool returns 2.

Revision history for this message
Andrew Simmonds (andrew-c-side) wrote :

Using the exact sequence shown I get the same incorrect result.

Inserting a multiply between the 2 and ( gives the correct result.

Changed in gcalctool (Ubuntu):
status: New → Confirmed
Revision history for this message
Michał Dulko (michal-dulko) wrote :

http://epsstore.ti.com/OA_HTML/csksxvm.jsp?nSetId=103110 - explains this behaviour a little. Is it intended?

Revision history for this message
Andrew Simmonds (andrew-c-side) wrote :

There's nothing in the help that describes this situation but a look at the equation parser in the source would seem to agree with the behaviour you have described.

So 48÷2(9+3) is equivalent to 48÷(2x(9+3)) i.e. the precedence of the multiplication is raised in this situation.

Changed in gcalctool (Ubuntu):
status: Confirmed → New
Revision history for this message
Andrew Simmonds (andrew-c-side) wrote :

Since help currently makes no mention of this, I suggest adding it to the "Basic Equations" page.

Changed in gcalctool (Ubuntu):
status: New → Confirmed
Changed in gcalctool:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.