Open JimmyCushnie opened 4 years ago
I worked on this for a while today, but I am unsatisfied with the neatness and reliability of the code. It also feels wrong to support addition/subtraction/division, but not multiplication, and not brackets.
I'm scrapping the work I've done so far on this feature. I think the proper implementation is to use some lightweight third party library that supports parsing a variety of mathematical operators.
I left the code I've written so far in the add-subtract-floats
branch; see commit a165098.
@ForLoveOfCats Kindly sent me this link today, and it seems like exactly what is needed for this feature: https://en.wikipedia.org/wiki/Shunting-yard_algorithm
Today I had to write
0.5333333333
. It would be much better to write1/3 + 0.2
.