[Desktop-packages] [Bug 275645] Re: xcalc has order-of-operations problems
I suppose the flaw does not exist in TI-30. Why would they want to mimic an old scientific calculator, that can't do basic arithmetic right? Besides, the manual page of xcalc tells (as for the TI-30 mode): 'It should be noted that the operators obey the standard rules of precedence. Thus, entering "3+4*5=" results in "23", not "35".' (HP-10C mode on the other hand does has completely different approach in the order of operations, and xcalc emulates it only, if it is started with -rpn option. ) The bug exists in Ubuntu 14.04, too. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to x11-apps in Ubuntu. https://bugs.launchpad.net/bugs/275645 Title: xcalc has order-of-operations problems Status in x11-apps package in Ubuntu: Confirmed Bug description: Binary package hint: x11-apps Under Ubuntu 8.04.1, running the version in x11-apps_7.3+1_i386.deb, the calculator program xcalc has problems with the order of operations. 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 manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/x11-apps/+bug/275645/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 275645] Re: xcalc has order-of-operations problems
@jarnos My hypothesis in the original post is that, when the calculator should close two levels of implicit grouping, it closes only one. Regardless of whether that is correct, there is a program, and it must follow some algorithm, so there must be a rule, whether or not we know it. If the rule was programmed deliberately, then it was by design. Of course, whether by design or not, it is a flaw. @richwareham is just wondering whether or not this is a flaw in the TI-30 or HP-10C calculators that xcalc deliberately copies. In other words, was the bug introduced in those historical calculators, or was it introduced in xcalc? (And in the fomer case, then what should we do about it?) This report is 7 years old, and I had forgotten ever making it, but the bug is still there in my current system! (Although to be fair, I'm still running Ubuntu 12.04.) -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to x11-apps in Ubuntu. https://bugs.launchpad.net/bugs/275645 Title: xcalc has order-of-operations problems Status in x11-apps package in Ubuntu: Confirmed Bug description: Binary package hint: x11-apps Under Ubuntu 8.04.1, running the version in x11-apps_7.3+1_i386.deb, the calculator program xcalc has problems with the order of operations. 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 manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/x11-apps/+bug/275645/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 275645] Re: xcalc has order-of-operations problems
If it were by design, what would be the calculation order rule? It calculates 2*2^2+2 so that + has higher precedence than *. On the other hand, it calculates 2*2²+2, 2+2*2^2 and 2*2+2 so that * has higher precedence than +. This is a bug. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to x11-apps in Ubuntu. https://bugs.launchpad.net/bugs/275645 Title: xcalc has order-of-operations problems Status in x11-apps package in Ubuntu: Confirmed Bug description: Binary package hint: x11-apps Under Ubuntu 8.04.1, running the version in x11-apps_7.3+1_i386.deb, the calculator program xcalc has problems with the order of operations. 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 manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/x11-apps/+bug/275645/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp