in reply to Re: Reverse Polish Notation Question
in thread RPN Question

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.

Replies are listed 'Best First'.
Re^3: Reverse Polish Notation Question
by GotToBTru (Prior) on May 01, 2015 at 20:48 UTC

    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.

        Okay, not complete so I had to add some things like, say, output. But it does appear to work.

        Starting with: 3(7x-1)+10x-4+3x=90x+1 it outputs: 3 7 x * 1 - * 10 x * + 4 - 3 x * + 90 x * 1 + -

        So .. what will you do with this? What was the point of getting it into RPN in the first place?

        Dum Spiro Spero
      I posted the code that I wrote, I'm hoping nothing is too wrong with it.