# Create a polish notation calculator [duplicate]

This question already has an answer here:

Your task is to create a polish notation calculator.

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

Your calculator should implement integer addition, substraction multiplication and division.

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 !

## marked as duplicate by a spaghetto, FryAmTheEggman, Maltysen, DJMcMayhem♦, AdnanJun 18 '16 at 20:20

• 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