How it works: First it converts the input to a list of "tokens" (a token is a number or operator) Then, it converts the list of tokens into postfix format, which is a different way of writing expressions, where the operator goes after the 2 numbers. This is done by the shunting yard algorithm Finally, it uses a stack machine to go through the postfix token list, and works out the answer In short: It tokenizes, converts to postfix, and then evaluates