math-expressions
math-expressions copied to clipboard
Negative zero
math_expressions: ^2.0.0
I'm wondering if this is a bug or an expected behavior?
Expression exp = Parser().parse("-1*0");
double eval = exp.evaluate(EvaluationType.REAL, null);
print(eval);
// -0.0
Thanks for the report. Looks like this is unintentional, as Dart itself evaluates -1*0.0
to positive zero, and only yields negative zero for 1*-0.0