xcalc has order-of-operations problems
Bug #275645 reported by
Toby Bartels
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
x11-apps (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: x11-apps
Under Ubuntu 8.04.1, running the version in x11-apps_
To recreate this bug, run "xcalc" from the command line, then type "2*2^2+2=". The result displayed should be "10", but instead it is "12". Note that "2+2*2^2=", "2^2*2+2=", "(2*2^2)+2=", and "2*(2^2)+2=" each give the correct result.
My guess is that the program has problems when it must close two levels of implicit grouping at once. In effect, it treats the problematic input above as if it were "2*(2^2+2)=". This interpretation is consistent with other examples that I've tried.
To post a comment you must log in.
Same result here. The question is whether this is a bug or by design. The program aims to emulate a TI-30 or an HP-10C so I suppose the ultimate reference is typing the same into one of those calculators.
For reference, the 'gnome-calculator' program in scientific mode produces '10' unlike xcalc which does indeed produce '12'.