# Create a polish notation calculator [duplicate]

For those who don't know what is polish notation, it's a mathematical notation where operators are before the operands.

Eg: + 1 2 = 1 + 2

Standard loopholes are forbidden but you are allowed to use a language even if it's newer than the challenge. Using eval is also forbidden.

Test cases:

Input: + 1 2
Output: 3

Input: * + 3 4 2
Output: 14

Input: / * + - 3 2 9 3 2
Output: 15


Since this is code-golf, the answer with the less bytes win !

• @Maltysen No, i add a clarification – TuxCrafting Jun 18 '16 at 20:05
• Is / integer division, rational division or floating-point division? This is also pretty much a duplicate of codegolf.stackexchange.com/q/221/8478, because any of those solutions can be used here by reversing the tokens first (and since neither challenge allows eval neither order gives a particular advantage to any approach). – Martin Ender Jun 18 '16 at 20:10
• @MartinEnder <s>It's not a duplicate, since this question ask for a polish notation calculator, not a reverse polish notation one</s> Haven't seen the reversing token part. Reversing the tokens would be probably longer than implementing directly a polish notation calculator. Oh and all operations are integer – TuxCrafting Jun 18 '16 at 20:11
• – Blue Jun 18 '16 at 20:14