With negative numbers ( using a unary '-' ), such as the examples:
-6(5+3)/2
(5+3)*(-2+1)
How is this converted to postfix? I haven't really tackled the issue too deep but it seems like it may interfere with a minus in postfix. I'd wager a guess that these would be converted as:
6-53+*2/
53+2-1+*
But in evaluating the second one, I could see myself ending up with a loose end at 7*. I hope you're following. If you know how these are handled, please tell me. Perhaps I should put parenthesis in the postfix such as:
(-6)52+*2/
53+(-2)1+*
Any suggestion or answers on how this is handled? The way my program is set up, it's currently accepting a string, converting to a postfix string and evaluated to a long. Thanks.