3 ms·
Looks cool! I was playing around with weird/edge case inputs and came across this one that gives a strange result: `(200000 * 23323 * 2423 * 4223 + 30%)` => `6
by timvdalen 6y ago
Looks cool!
I was playing around with weird/edge case inputs and came across this one that gives a strange result: `(200000 * 23323 * 2423 * 4223 + 30%)` => `62048638409419990,62048638409420000,62048638409419990,62048638409420000` I don't know if this is some sort of thousands-separator or a list of numbers, but I'd be interested to learn how the parser sees this.
For reference, both `(200000 * 23323 * 2423 * 4223) + 30%` and `(200000 * 23323 * 2423 * (4223 + 30%))` give sensible results (once you get how the percent operator works).
- perryizgr8 6y agoThanks for finding that bug! The parser is confused. My pattern can match to that input in 4 different ways. So it is outputting all of those 4 ways. However only 2 are unique. The two ways are: - (200000 * 23323 * 2423 * 4223) + 30% - (200000 * 23323 * 2423 * (4223 + 30%)) Now I'm not sure how to fix this.