Menu

RPN question

2005-01-20
2013-05-14
  • Nobody/Anonymous

    Hello all!

    Qalculate is great - nothing to question there!

    But here: With qalculate-0.6.2 I was able to calculate in RPN:
                  "1 1 1 +"
    and got:
                  "3"
    With qalculate-0.7.1 the result is "2" and the warning message "Unused stack values." I don't know if something like
                  "1 1 1 +"
    should be valid in RPN but it would be nice to be able to deal with more than two operands at the time. (BTW: "(1 1 1) +" makes qalculate crash, which is  a rather unpleasant behaviour.)

    Thanks for your assistance!

     
    • Anonymous

      Anonymous - 2005-01-21

      hi.

      I never use the RPN mode myself and therefor it's not well tested. Also, I'm really not very familiar with RPN so I'm not completely sure that the syntax is correctly implemented in Qalculate!. "1 1 1 + +" and "1 1 + 1 +" do however work and wouldn't 1 enter 1 enter 1 enter + in regular RPN calculator put 2 (with 1 left in the stack) at the top of the stack?

      "(1 1 1) +" should not crash, but is it a valid RPN expression?

       
    • Nobody/Anonymous

      Thank you for your quick answer. I know nearly nothing about RPN - which is proved by my posting - however I find it useful. For a RPN calculator with visible stacks it's evident, that "1 1 1 +" results in 2 with 1 on top of the stack. But I thougt - since you can't make use of the operands left on the stack in qalculate (hopefully that's not nonsense) - it would be at least convenient to use the operator, if only one operator is entered, for all operands. That open such scientific use cases like adding the prices of a bill without having to count how much pluses you have to enter !-)

      Please don't get me wrong - qalculate is really nice. I would like to be able to offer the code for the features I suggest but I can't.

      "(1 1 1) +" is certainly not valid in RPN. And finally: Wouldn't it be good to be able to copy and paste the result?

      Thanks for your progam!

       
    • Anonymous

      Anonymous - 2005-01-24

      I initially thought that it was a good idea to keep the RPN syntax strict, but have now changed the code so that the last operator is used for leftover stack values. I might add a warning (which can be turned of).

      You can copy the result with Ctrl+Alt+C, Edit->Copy Result, from the right-click context menu, or from the history window. The result cannot be marked because it's displayed with an image instead of plain text.

      Thanks for your suggestions.