Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Programming Order of Operations

$
0
0
I apologize if this is the wrong forum. It seemed like a catchall category and this is a general question.

I'm writing a calculator and am thinking about how to implement order of operations. Infix notation seems like a pain to get order of operations implemented. Postfix seems like a much nicer alternative. Would you suggest using postfix notation or something different?

Along the same lines of the question, how would you parse something like 3+sin(40)-(4*5)? The sin seems like a bit of a stumbling point.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>