expressions
expressions copied to clipboard
Wrong answer
This library is great, but shows wrong answer when for this expression. "-4+4" should be 0 instead it shows 8.
Try 0-4+4 I think library needs something on left of minus sign
Yes, but it shouldn't be the case. This should be added as a bug.
I understand your concern, but internally lib calls
left - right() to subtract expressions. In above case left is missing so it might give some issue.
Still this needs to be fixed
@jaydangar It worked fine in my case
const expression1 = '-4+4';
final result1 = ExpressionUtils.evaluate(
expression: expression1,
map: map,
);
expect(result1, 0);
The test case passed. Expression Utils is just a wrapper of the lib in my case