Hi everyone I made a postfix calculator and it seems to work in all cases except when I use unary negation or square root a number. It calculates a text file and reads it line by line.
Asked
Active
Viewed 65 times
-1
-
Square-root an UNARY negate are _unary_ ops, so why are you popping and using _two_ operands? – Kevin Anderson Sep 02 '17 at 22:10
-
I was playing around with code forgot to edit it out. Thanks for pointing it out – masalaman Sep 02 '17 at 22:13
-
Printing "Goodbye!" in response to a `NullPointerException` is asinine, as is catching it in the first place. – user207421 Sep 03 '17 at 03:52