in reply to RPN Question

Post your code! How on earth are we expected to help when we can't see what you're doing?

Dum Spiro Spero

Replies are listed 'Best First'.
Re^2: Reverse Polish Notation Question
by nat47 (Sexton) on May 01, 2015 at 20:35 UTC
    I don't actually have any code that isn't working or needs fixing. I've gotten to the point where I have converted a single-variable linear equation string into a RPN string. I posted the string in the OP. Now, I have no idea where to go from here. I'm thinking it was a mistake to try to use RPN to solve for 1 variable.

      When I simplify your equation, I get -8 = 0. I suppose the algorithm works the same on solvable versus insolvable equations, but the latter makes it harder to test your results!

      What you have does not resemble RPN as I understand it.

      2 (4x - 8) + 3x = 11x + 1 - 9 LHS: 4 x * 8 - 2 * 3 x * + RHS: 11 x * 1 + 9 -
      Dum Spiro Spero
        Agh, I spent several hours trying to get my RPN code to work. I swore I had it working correctly.
        I posted the code that I wrote, I'm hoping nothing is too wrong with it.