Expression parser and calculator

by Thomas Nijssen

Version 1 (September 19, 2020)

Download (5 downloads)

Simple example of a calculator for math expressions. Give it an input like "5+(1-2)" and it will first convert it to Reverse Polish Notation (RPN) «5 1 2 - +» and then evaluate it using a stack. It respects order of operations (PEMDAS - no exponent in this version)

This version only handles addition, subtraction, multiplication, division, and parentheses. Negative numbers don't work yet.

You can use this as an example for how to parse user input.

5.0 average rating from 1 reviews

5 stars
1
4 stars
0
3 stars
0
2 stars
0
1 star
0
Reports
0

Reviews and ratings can be submitted in the app.