4 ms·
Well, to be fair, your calculator seems to miss the point of being a calculator... > 10/2*2 2.5
by erezsh 14y ago
Well, to be fair, your calculator seems to miss the point of being a calculator...
> 10/2*2
2.5
- coolSCV 14y agoClearly a bug. Thanks when I have more time I will fix it. I didn't give much thought to operator precedence, I assumed the user would specify it using parentheses. The idea is what is important though. Recursive descent parsing uses the functions that correspond to types in the grammar to mutually call each other thus parsing the expression recursively in a descending fashion.
- coolSCV 14y agoI decided to simply add to the description, "use parentheses to specify operator precedence."