A Basic Calculator
I am certain you’ve used a calculator at some point, and might have need for one sooner than later. Applies to me too. Sometimes, I whip out my phone, open the calculator, and get it to compute some simple arithmetic operations. Oh, what is 100 * 15 / 3 + 10000 – 50 * 5.598? Easy peasy you say; and I agree! Nonetheless, such computations are easy to screw up; however screwing up is impossible if you follow the correct order of operations. In which case the result is 10220.1
How do we implement functionality for basic arithmetic operations? How does your calculator know to correctly compute stuff? Ah! Got curious about this, and wrote a basic calculator. You can poke around the code here. Time permitting, I might flesh out the logic in a series of blog posts!