3/2/0.5 == 3When you try to do it by evaluating each operator immediately it gets teh wrong result:

3/2/1/2 == 0.75Because

3/2 == 1.5 1.5/1 == 1.5 1.5/2 == 0.75To get the correct result you would need to process the whole expression instead of individual "bits". One way to do that is to accept your inputs in Reverse Polish Notation instead of "normal math", but that's a PITA because nobody uses that in the real world so it's not likely to impress anyone that they have to learn a new way to enter numbers:

3, 2, /, 1, 2, /, /is the RPN for what you want!

The other is to dump completely what you have and start again processing whole lines of an expression, and implementing operator precedence a well as brackets (which you need to evaluate your expression correctly:

(3/2)/(1/2) == 3That's not trivial, but it is a good learning experience!