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

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

Replies are listed 'Best First'.
Re^4: Reverse Polish Notation Question
by nat47 (Sexton) on May 01, 2015 at 20:50 UTC
    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 was thinking that putting an expression into RPN would be a good idea since it eliminated all () and the expression could be thought of like a tree
Re^4: Reverse Polish Notation Question
by nat47 (Sexton) on May 01, 2015 at 21:12 UTC
    I posted the code that I wrote, I'm hoping nothing is too wrong with it.