# Questions tagged [math-expression-eval]

Questions related to the parsing (and possibly the evaluation) of free-form mathematical expressions in strings, lists, or streams

166 questions
Filter by
Sorted by
Tagged with
5k views

### Expression parser using the shunting yard algorithm

I am trying to implement an expression parser via the shunting yard algorithm about which I learnt here. I am able to get the correct results for the cases I'm testing, but I think it would be better ...
20k views

### Math expression solver

I've recently stumbled upon an interesting challenge for me: You should develop C application, that solves math expressions. Operations such as (+,-,*,/) should be supported, as well as (cos, sin, ...
7k views

### Numeric expression parser - calculator

In particular, if someone could describe a better way to go from the tokenized list to the Expression tree, it would be super helpful. I would like to get rid of the casting in the parser but am not ...
340 views

### Refactoring calculator expression

I was doing a simple exercise to calculate the amount based on an expression. For example: (((2*2)+(3*5/5)+(2*5))) outputs 17 ...
46k views

### Postfix evaluation using a stack

I just wrote the code to evaluate a postfix expression and would like it if someone reviews it for me, it works perfectly fine but I'm having trouble adding the character "=" at the end. ...
348 views

### Advanced Calculator Kata

This is the CalculatorAdvanced Kata from the Kata gem. I've just finished it and would love some feedback on my solution. ...
621 views

### Parser for an arithmetic expression

I am a student, and I am doing websites as freelancer. Lately I have started learning design patterns, refactoring, and test-driven development so that I can improve the maintainability, performance, ...
427 views

### Evaluating expressions with various mathematical methods

I have started to learn Java and I need your critique for my first program. It is an interpreter that can calculate any expression including abs(), ...
5k views

### Infix to Postfix conversion in Java

I have written an infix-to-postfix program that I would like reviewed and with a few suggestions on improving it, such as a more modularized approach. ...
4k views

### Calculating postfix notation using two forms of input

My postfix program essentially allows the user two input options to calculate a postfix equation: Confirmations after each input (after an input, the user is ask for another number, operator, or ...
28k views

### Calculator application running on a console

I have a calculator created using C# that is running on a console. The calculator accepts a string input (e.g. 5+5) then produces the result (5+5=10). It will then prompt the user to enter another ...
939 views

### RPN Evaluator that writes the results to a text file

For homework, I had to write an RPN Evaluator and write the results to a text file. I've done all that, but it feels weird, like the writing to my results text file. It also doesn't feel efficient. ...
2k views

### Calculator parsing S-expressions

The following program is supposed to be a (command line) calculator that parses expression following syntax similar to Lisp's S-expressions. Some examples: \$ echo "(+ 5 5)" | ./a.out 10....
2k views

### RPN-Stack-Based Recursive Calculator Needs Tuneup

This function takes an array of strings and numbers and recursively processes it as a kind of "calculating program". The structure is based on Reverse Polish Notation, so the top object in the stack (...